A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Display External Image to .swf With Resizing?

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    19

    Display External Image to .swf With Resizing?

    Using AS2 and Flash 8...

    I'm currently looking for a way to display a image file that is outside of the .swf in my Flash program, including a way to resize it.

    I just looked through the options of using the Loader component with the .contentPath function. Even though this method displays the image perfectly, I can't for the life of me figure out how to resize the Loader.
    Here's my code for this strategy if it helps:
    Code:
    image_number = 0;
    initialization={autoLoad:true,contentPath:"",scaleContent:true};
    image_number++;
    current_mc_depth++;
    _root.attachMovie("Loader", "image"+image_number, current_mc_depth, initialization);
    _root["image"+image_number].contentPath = "banner.jpg";
    This basically dynamically creates the "Loader" component with all of it's settings initialized. Then, using .contentPath, it displays my "banner.jpg" which is in the same directory as my .swf file.

    Now I'm looking for a way to resize the thing.

    Thanks for your help!

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Don't use a component. They are more trouble than anything. Try the MovieClipLoader Class (check liveDocs in my footer). The onLoadInit event fires where the external doc is loaded.

    gparis

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