Video: Loading assets with the new ProLoader class

The Loader class can be used to load external SWF files. But problems can occur when you use it to load a SWF that contains TLF text fields. To overcome this, Flash now has the ProLoader class. The great thing about the ProLoader class is that it's added to the Code Snippets panel. So you can see how it works without having to look it up in the documentation. I'll open the Code Snippets panel and then find the Load and Unload actions and expand that folder.

In this course, author Todd Perkins demonstrates key changes in the CS5.5 release of Adobe's interactive design and animation software. This course covers workflow improvements, enhanced ActionScript features (including new code snippets for AIR and several mobile frameworks), file optimization techniques, and extended support for Android and iOS app development in AIR.

Loading assets with the new ProLoader class

The Loader class can be used to load external SWF files.But problems can occur when you use it to load a SWF that contains TLF text fields.To overcome this, Flash now has the ProLoader class.The great thing about the ProLoader class is that it's added to theCode Snippets panel.So you can see how it works without having to look it up in the documentation.I'll open the Code Snippets panel and then find the Load and Unload actionsand expand that folder.

I can double-click the Click to Load/Unload SWF, or Image action.So I double-click that and it says, This action requires an object tobe selected on Stage.So I select the movie clip of the kid on the stage and I'll go back to the CodeSnippets panel and double-click, Click to Load/Unload SWF, or Image.And here's the code, so let's take a look at it.So you note that it's pretty much the same as using a Loader class except forits called ProLoader.

You can look at the differences in Flash documentation, but if you lookinside of this function, you'll see that you simply create a new instance ofthe ProLoader class.You call its Load Method, and add it to the stage.I'll change the URLRequest to an actual file on my computer which is calledTLF.swf, and that's really it.So I'll test the movie and click on the kid.We'll see the SWF file load;it has TLF text with no problem at all.

So remember, if you're loading SWF files that contain TLF text fields, you canuse the ProLoader class to get the best performance.And if you don't want to write out the code by hand, you can simply add the codesnippet and Flash will write all of the code for you.

There are currently no FAQs about Flash Professional CS5.5 New Features.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.

Already a member ?

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships.
Learn more

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.

Sign up and receive emails about lynda.com and our online training library:

new course releases

newsletter

general communications

special notices

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

new course releases

newsletter

general communications

special notices

Here’s our privacy policy with more details about how we handle your information.