History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-12933
Type: Bug Bug
Status: Closed Closed
Resolution: Not a Bug
Assignee: Gaurav Jain
Reporter: David Gofman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Flex SDK

"Compile CSS to SWF" does not work in subfolders

Created: 10/07/07 03:10 AM   Updated: 10/19/07 04:25 PM
Component/s: MXML Compiler - Error Reporting
Security Level: Public (All JIRA Users )

Issue Links:
Cloners
This issue is cloned by:
SDK-13096 CLONE -"Compile CSS to SWF" does not ... Closed
 

Severity: Non Functioning
Reproducibility: Every Time
Discoverability: Medium
Found in Version: SDK Flex2.0.1 - HotFix 3 (Released)
Milestone:
Affected OS(s): All OS Platforms - All
Steps to Reproduce:
Steps to reproduce:

1. Create assets folder.
2. Create com/adobe/skins folder
3. Create images folder
4. Create style.css under assets
5. Create MyRectangularBorder file under com/adobe/skins folder and just add line "class RoundedBorderSkin extends MyRectangularBorder {}"
6. Copy some image to images folder
7. Edit style.css add line ".text { borderSkin: ClassReference("com.adobe.skins.MyRectangularBorder "); }
8. Right Click on file and pick "Compile CSS to SWF"
9. I got two errors: "1120: Access of undefined property MyRectangularBorder" and "1172: Definition com.adobe.skins:MyRectangularBordercould not be found."
10. Modify that line to: ".test { myImageIcon: Embed(source="/images/myImage.png"); }
11. Error will be: "Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "/images/myImage.png")'. "
 
 Workaround (if any):
 
Moving style.css to Project root level. Works fine, but I would like to create multiple folders, same css file name and use diffrent styles.
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: Yes
QA Owner: Gaurav Jain
Resolved by: Paul Reilly
Participants: David Gofman, Gaurav Jain, Lauren Park and Paul Reilly


 All   Comments      Sort Order:
David Gofman - [10/07/07 03:11 AM ]
Same issue in Flex 3

Gaurav Jain - [10/08/07 01:21 PM ]
Reproduced with FB 3.

Lauren Park - [10/15/07 02:57 PM ]
Opened.

Paul Reilly - [10/17/07 03:45 PM ]
The project root directory is only implicitly added to the source path when compiling style.css in the project root directory. When you move style.css to the assets folder, the project root directory is no longer in the source path, which explains why MyRectangularBorder could not be found. Adding the project root directory to the source path won't work, though, because then style.css will be under two directories in the source path.

One solution is to create a src directory and move com/adobe/skins under the src directory. Then add src and images to the source path. Then remove the "/images" prefix from the Embed. Finally compile style.css like this:

mxmlc -source-path=src,images assets/style.css

David Gofman - [10/17/07 10:14 PM ]
Same problem when I try to compile embed images:

MXML:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Style source="assets/style.css"/>
<mx:Image initialize="{event.target.source=event.target.getStyle('helpIcon')}" styleName="imageStyle"/>
<mx:TextInput styleName="textStyle"/>
</mx:Application>

SRC/RoundedBorderSkin:
package src
{
import mx.skins.RectangularBorder;
public class RoundedBorderSkin extends RectangularBorder {
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
drawRoundRect(0, 0, unscaledWidth, unscaledHeight, {tl:5, tr:5, bl:5, br:5}, 0xff0000, 1);
}
}
}

CSS/style.css:
.imageStyle{
    helpIcon: Embed(source="images/help.swf");
}
.textStyle{
    borderSkin: ClassReference("src.RoundedBorderSkin");
}


mxmlc" -source-path=src,images assets/style.css
Loading configuration file C:\eclipse\Adobe_Flex_Builder_2_Plugin\Flex SDK 2\frameworks\flex-config.xml
C:\eclipse\workspace\testLib\assets\style.css(2): Error: Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "images/help.swf")'.

        helpIcon: Embed(source="images/help.swf");

David Gofman - [10/17/07 10:20 PM ]
No luck if I try to compile RoundedBorderSkin class too:

mxmlc -source-path=src,images assets/style.css
Loading configuration file C:\eclipse\Adobe_Flex_Builder_2_Plugin\Flex SDK 2\frameworks\flex-config.xml
C:\eclipse\workspace\testLib\assets\style.css(5): Error: Access of undefined property RoundedBorderSkin.

    borderSkin: ClassReference("src.RoundedBorderSkin");

C:\eclipse\workspace\testLib\assets\style.css(5): Error: Definition src:RoundedBorderSkin could not be found.

    borderSkin: ClassReference("src.RoundedBorderSkin");

David Gofman - [10/17/07 10:24 PM ]
Using compiler 3.0, getting same errors

mxmlc -source-path=src,images assets/style.css
Loading configuration file C:\eclipse\Flex Builder 3 Plug-in\sdks\3.0.0\frameworks\flex-config.xml
This beta will expire on Thu Jan 31 00:00:00 PST 2008.
C:\eclipse\workspace\testLib\assets\style.css(2): Error: Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "images/help.swf")'.

        helpIcon: Embed(source="images/help.swf");


\mxmlc -source-path=src,images assets/style.css
Loading configuration file C:\eclipse\Flex Builder 3 Plug-in\sdks\3.0.0\frameworks\flex-config.xml
This beta will expire on Thu Jan 31 00:00:00 PST 2008.
C:\eclipse\workspace\testLib\assets\style.css(5): Error: Access of undefined property RoundedBorderSkin.

    borderSkin: ClassReference("src.RoundedBorderSkin");

C:\eclipse\workspace\testLib\assets\style.css(5): Error: Definition src:RoundedBorderSkin could not be found.

    borderSkin: ClassReference("src.RoundedBorderSkin");

Gaurav Jain - [10/18/07 04:57 PM - edited ]
It works when i tried suggestion from Paul, here is what i did:

I created one more src folder and moved RoundedBorderSkin.as under the new src folder.

I added the following to the compiler options

-source-path=src,images

So my project structure now looks like:

Root Folder
    |
    Assets
          |
          styles.css
    |
    Images
          |
          help.swf
    |
    src
          |
          src
               |
               RoundedBorderSkin.as
    |
    testLib.mxml

David Gofman - [10/19/07 04:25 PM ]
Hello Gaurav,
I tried your solution, its work for me too (but looks like a hack for me) , but I am still cannot solve problem what I described in SDK-13096, using "Compile CSS to SWF"
Please revisit bug SDK-13096.
Thank you very much!