Learn how to load images externally from flash (20) Flash cs3.0 every day

Source: Internet
Author: User

Today I started to read some external loading images, because as3.0 does not have the loadmovie class, so as3.0 has to change its mind. However, there are a lot of confused things. I have read some stuff about containers before and cannot understand them. Maybe I haven't gotten started yet ......

Now, let's put a program that loads images externally ...... In fact, it is not a good thing, but it is not a good method. I just want to know about flash. The class in the display package is the first place to learn .. After all, too many good things are worth studying .......

 

 

Create a loader object that can be used to load files (such as SwF, JPEG, GIF, or PNG files. Callload()Method to attach a resource to a sub-level of the loader instance. You can then add the loader object to the display list (for example, by using the displayobjectcontainer instance'saddChild()Method ).

 

 

Code:

VaR Loader: loader = new loader (); // create a loader Class Object

Loader. contentloaderinfo. addeventlistener (event. Complete, loading );

Loader. Load (New URLRequest ("1.jpg"); // loads images externally.

Addchild (loader); // Add an object to the display list

 

Function loading (Event: Event ){

VaR _ content: displayobject = event.tar get. content;

 

}

 

There are still some things I don't quite understand. I will solve it slowly tomorrow ..... Who will discuss it together?

Q: Is there a good place to write this code?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.