Flex/AIR Embed() Differences


i have flex application i'm trying compile air (see post http://forums.adobe.com/thread/419487?tstart=0).  in flex app, embed images so...

 

    <mx:style>       
        .commonbutton
        {
            up-skin:            embed("/assets/max_up.png");
            over-skin:          embed("/assets/max_over.png");
            down-skin:          embed("/assets/max_up.png");
        }
    </mx:style>

 

this works fine in flex.  using same directory structure (assets subdirectory src), air compiler throws errors this...

 

    invalid embed directive in stylesheet - can't resolve source 'embed("/assets/max_up.png")'.
   
why syntax , structure work fine in compiling flex, , fail when compiling air?

more importantly, there work-around?

 

    -tri

not sure why happening, try omit beginning forward slash , see happens. also, try , replace forward slashes backward slashes.

 

one other idea may need have paths relate air specific path paradigm, such this:

 

import flash.filesystem.file;  var tempfiles:file = file.applicationstoragedirectory; tempfiles = tempfiles.resolvepath("images/"); trace(tempfiles.url); // app-storage:/images 

or this:

 

import flash.filesystem.file;  var directory:file = file.documentsdirectory; directory = directory.resolvepath("air test");  file.createdirectory(directory); trace(directory.exists); // true 


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???