Loading SWFs and Images in Flash using ActionScript 3

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
5,921
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 27, 2008

Loading external media like SWFs and bitmaps (JPGs, GIFs and PNGs) is a vital task in Flash, but that code has totally changed in AS3. This short lesson shows how to load all external media in AS3 (including basic error checking) and is a great illustration of the consistency of coding in the latest version of ActionScript. Extracted R Blank's course 'Practical ActionScript 3' at http://online.richmediainstitute.com

  • likes, 5 dislikes

Link to this comment:

Share to:

Uploader Comments (richmediainstitute)

  • It's called addChild, because you are adding a child display object to a parent display object. The 'parent' has been called 'parent' for years -- now we are calling the child, 'child'. The reason we don't call it 'addSusan' is because that would make no sense.

  • same code to load SWFs as to load bitmaps

  • This would have been an excellent tutorial if you could read the code :P

  • You can view the high-res version of this video, and download the code, on our website. I can't post the direct URL in comments because youtube doesn't allow it.

see all

All Comments (8)

Sign In or Sign Up now to post a comment!
  • @mel2000 This lesson is complete. If nothing happened when you clicked play, then your code is most likely not hooked up to your button correctly, with the event listener. Perhaps its an instance name issue (i.e., the instance name of your button)?

  • @SinginPuffle loader.unload ();

  • Is there another part to this tutorial that's missing? When I loaded your code into the first frame of a newly created ActionScript layer, nothing happened when I pressed the Play button.

  • What if you wanted to Unload the swf? :\

  • wtf is this "AddChild" nonsense? why dont they call it "AddSusan" or AddFarmBell" wtf is wrong with adobe... AS3 sucks ass.

  • How would you configure a button so that when clicked it opens an .swf file in the UILoader?

  • Ah awesome. Thanks I'll look for it!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more