A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to load image to stage?

Hybrid View

  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    63

    Question 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?

  2. #2
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    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.

  3. #3
    Member
    Join Date
    Jun 2009
    Posts
    63
    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?

  4. #4
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center