|
-
How to load image to stage?
Hi
I need to do a multi-languages flash UI.
The text images will change for different languages.
I can do it for text.
But, how can I load a particular image or image button (with getURL()) to a fixed x,y co-ordinates in stage?
-
rabid_Delineator
getURL isn't a supported method in as3. So you can pretty much throw that idea out the window. And even if you were to use navigateToURL , it wouldn't load anything to the stage. If you need to load an image , just use a loader , and a urlrequest , then add the loader as a child to a sprite that sits on stage at a fixed position. Since you are localizing your text already , you should be able localize the url for the urlrequest also.
-
var container:Sprite = new Sprite() ;
container.x =75 ;
container.y =40 ;
this.addChild(container) ;
//
var loadJpg:Loader = new Loader() ;
var reqURL:URLRequest = new URLRequest("001.jpg") ;
loadJpg.load(reqURL) ;
//
container.addChild(loadJpg) ;
It can load external image, if the jpg already import to CS3 component, how can I load it?
-
rabid_Delineator
loader.load("img/somefolder/somefolder/anImage.jpg");
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|