Flash Tip: Get the width of an external movie

Source: Internet
Author: User
Skill _root.createemptymovieclip ("MC", _root.getnexthighestdepth ());
Mc.loadmovie ("logo.gif");
Trace (mc._width);

The result, though, is 0, because the Loadmovie has a delay, and the external real movie can be loaded into the Loadmovie after the second frame. So:

_root.createemptymovieclip ("MC", _root.getnexthighestdepth ());
Mc.loadmovie ("logo.gif");
_root.onenterframe = function () {
Trace (mc._width);
};

The effect is coming out.
0
88
88
88
.......
Also to be noted are:
1. Do not write _root.onenterframe = Mc.onenterframe = Because the load will overwrite the original event.

2. When Loadmovie calls SWF, the movie's _width is not the publication width of the movie, it is the width of the current frame maximum coverage and the MC principle is the same



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.