How to preload using AS 3.0?

Hi!
I am using ActionScript 3.0 with Flash 9.
I have asked this in many diferent places without any answer
yet.Hopefully I will get my ansewers here.
I have this code to preload external swf files :
var request:URLRequest = new URLRequest("content.swf");
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loadComplete);
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number =
event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
trace("Loading: "+percentLoaded+"%");
function loadComplete(event:Event):void {
trace("Complete");
loader.load(request);
addChild(loader);
I want to make a class so I can use it for many swf
files(although I can put it in a function and still use it many
times) and I came up with this code which I dont know if it is
right:
package
import flash.display.MovieClip;
import flash.display.*;
import flash.text.TextField;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.ProgressEvent;
public class Carregador extends MovieClip
public var _Barra : MovieClip = new MovieClip();
public var _Texto : TextField = new TextField();
public var _Palco : MovieClip = new MovieClip();
public var _Movie : String;
public var loader:Loader = new Loader();
public function set Palco(value:MovieClip):void
_Palco = value;
public function set Barra(value:MovieClip):void
_Barra = value;
public function set Texto(value:TextField):void
_Texto = value;
public function set Movie(value:String):void
_Movie = value;
public function loadSwf():void
var request:URLRequest = new URLRequest(_Movie);
loader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loadComplete);
loader.load(request);
addChild(loader);
private function showPreloader(evt:Event):void
addChild(_Barra);
private function loadProgress(event:ProgressEvent):void
var percentLoaded:Number =
event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
_Barra.width = percentLoaded;
private function loadComplete(event:Event):void
removeChild(_Barra);
_Palco.addChild(_Movie);
Can You guys guide me throught the steps to make a class to
preload swf files into an empty movie clip in my movie?
thank you

The following package and class are in use on my site so you
can see what it does....
http://www.sd-dezign.com
I am using this exact code to preload a jpeg file (could be
any jpg, progressive jpg, gif, png or swf). I just wrote it like 2
days ago. Hope this helps you out.
This is the most basic of preloaders coded in AS3 and part of
an external package.
To use the package, it will need to be inside a folder called
cloader in the same area as the FLA file that uses it.
The second part is importing the package into the FLA and
then calling it with the necessary arguement which is the file you
want to load.
The third and final part is to add the preloader to the
display list.
Putting it all together, it would look something like
this....

Similar Messages

  • I have bought a Logo Preloader app, where do I see it and how do I use it

    I have bought a Logo Preloader app, where do I see it and how do I use it

    Hi Sheendequeen,
    You might want to check the links:
    http://www.adobe.com/devnet/flash/articles/concept_preloader.edu.html
    http://www.adobe.com/devnet/flash/articles/preloader_as3.edu.html
    Regards,
    Rave

  • How do I use Edge Web Fonts with Muse?

    How do I use Edge Web Fonts with Muse - is it an update to load, a stand alone, how does it interface with Muse? I've updated to CC but have no info on this.

    Hello,
    Is there a reason why you want to use Edge Web Fonts with Adobe Muse?
    Assuming you wish to improve typography of your web pages, you should know that Muse is fully integrated with Typekit. This allows you to access and apply over 500 web fonts from within Muse. Here's how you do it:
    Select a text component within Muse, and click the Text drop-down.
    Select Add Web Fonts option, to pop-open the Add Web Fonts dialog.
    Browse and apply fonts per your design needs.
    Muse also allows you to create paragraph styles that you can save and apply to chunks of text, a la InDesign. Watch this video for more information: http://tv.adobe.com/watch/muse-feature-tour/using-typekit-with-adobe-muse/
    Also take a look at these help files to see if they help you:
    http://helpx.adobe.com/muse/tutorials/typography-muse-part-1.html
    http://helpx.adobe.com/muse/tutorials/typography-muse-part-2.html
    http://helpx.adobe.com/muse/tutorials/typography-muse-part-3.html
    Hope this helps!
    Regards,
    Suhas Yogin

  • How do I use Panorama / Tab Groups with the keyboard?

    Yes I know that CTRL-SHIFT-E opens the panorama window, and then I can use the mouse to organize my tabs into groups.
    But how do I do this with the keyboard?
    I've [http://lifehacker.com/#!5719596/switch-between-tab-groups-in-firefox-with-a-keyboard-shortcut read] [http://ubuntuforums.org/showthread.php?t=1705714 that] Ctrl-`should move me through tab groups. That doesn't work for me on my Danish keyboard. (Where the ' and ` chars are weird. But is how they are on a valid standard Danish keyboard) I've tried changing the keyboard to USA and then moving through tab groups works fine.
    In short: Pretend I don't have a mouse. How do I use Panorama / Tab Groups?

    Sorry. These are both known bugs:
    [https://bugzilla.mozilla.org/show_bug.cgi?id=587010 Bug 587010] - Add keyboard UI for manipulated groups and tabs in Tab Candy
    and
    [https://bugzilla.mozilla.org/show_bug.cgi?id=626594 Bug 626594] - shortcut for switching tab groups is badly accessible on many non-US keyboard layouts

  • How do I use a custom UserInfo with a T3Client?

    This is related to my previous post, 4655. The problem is I if
    use a custom implementation of the interface
    weblogic.security.acl.UserInfo in a T3Client constructor, the
    client fails to connect. If I use
    weblogic.security.acl.DefaultUserInfoImpl, the client connects
    and disconnects without any problems. How do I use a custom
    UserInfo implementation with a T3Client?

    In don't know about the Gmail part, but for the Hotmail, try this link.
    Here's another link from a different source.

  • How do I use HP iPAQ H4300 WITH Windows 7?

    I recently upgraded from Windows XP to Windows 7.  How do I use my HP iPAQ h4300 pocket PC with this recently installed Operating System?
    Ed Walsh [Personal Information Removed]

    Hello edwalsh606,
    I understand you are seeking assistance with the iPAQ H4300 and your new Windows 7. I am sorry, but to get your issue more exposure, I would suggest posting it in the commercial forums, since this is a commercial product. You can do this at Notebook - HP ProBook, EliteBook, Compaq, Slate/Tablet PC, Armada, LTE.
    I hope this helps. Thank you for posting on the HP Forums. Have a great day!
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

  • How do I use my Time Capsule with hotel wired internet

    How do I use my Time Capsule as a wireless router on my hotel free internet ethernet cable?

    It may not be possible..
    If they use a web access page, then there is no way you can set the TC to authenticate.. you must use the computer to authenticate and then use the computer to bridge to the TC for wireless clients to access.
    Look up instructions on using ICS (internet connection sharing) in the Mac.
    eg for 10.6.8 http://support.apple.com/kb/PH6589
    eg http://support.apple.com/kb/PH10740
    Of course if there is no login then you could just use it.. but I doubt you would be asking if it just worked.

  • How do i use my own image with keying (or green screen)

    how do i use my own image witrh keying (or green screen)

    Put your sky clip on a layer below the clip you want to key. One or the other will be a connected clip. Apply  the Keying filter to foreground clip (the one with the green screen). The green will be seen as transparent and the sky will show through as the BG. Adjust as necessary in the Inspector.
    Good luck.
    Russ

  • How do I use ipod 5th classic with new itunes

    how do I use my old ipod classic 5th generation with the latest itunes software?

    The same way as before...
    If the new look of iTunes is confusing, it may look more familiar to you if you show the sidebar.  It is hidden by default to streamline the look and feel.
    From the iTunes menu bar, under View, select Show Sidebar.  With the sidebar not hidden, iTunes mostly works like it did before.

  • How do I use my airport extreme with my FIOS router?

    How do I use my AirPort Extreme base station with my FIOS Router to extend my network?  I have hard disks connected to my AirPort Extreme and would lik to access them.

    Probably can't answer all your questions - but.... I use a Linksys (wired and wireless) router as my primary entry point for FIOS. I use a Time Capsule and an Airport Express as a common wireless connection. So I have two visibile wireless networks and use them both depending on where I am in the house. Both the TC and AEx can be seen either wirelessly or wired from the entire network. Note - the Linksys provides all the DHCP - you set the apple routers as "bridge mode."

  • How do I use Qt and OpenGL with Visual Studio

    Hi! I mainly want to program in C++ and I want to use Qt and OpenGL with Visual Studio.
    I am currently revising C++ and later on i am going to start reading Qt and OpenGL. I have a background of
    Embedded firmware design(C and Assembly).
    The Visual Studio Version I have is 2013 ultimate. How do I use Qt and OpenGL with Visual Studio?
    Thanks
    Alexandros

    Hi ClassicalGuitar,
    The forum supports VS setup and installation. And your issue is not about the forum. I will move the thread to off-topic forum. Thanks for your understanding.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • How do i use my mac book with my HP 6510 e all in one series printer

    how do i use my mac book with HP photosmart 6510 e all in one series

    Hello Marilynatsea,
    Thanks for using Apple Support Communities.
    To learn more about printing in OS X on your Mac, and how to add a printer, take a look at the article linked to below.
    Mac Basics: Printing in OS X - Apple Support
    Cheers,
    Alex H.

  • How do I use my gigaware webcam with my mac?

    How do I use my gigaware webcam with my mac? I just bought this webcam on amazon http://www.amazon.com/gp/product/B00IJE0ISS/ref=oh_aui_detailpage_o07_s00?ie=UTF 8&psc=1 and I want to use it with my mac. Is there an adapter or any software to make it compatible? Thanks.

    Your amazon link states, in part, that this webcam is:
    Compatible with Microsoft Windows 7,Vista, XP, 2000
    Use a Mac OS X Compatible Webcam like one of those shown in the linked article instead.
    For best compatibility and security, also update your OS X Mavericks (10.9.2) to the current OS X version by restarting Mac and then downloading and installing OS X Mavericks 10.9.4 Update (Combo).

  • How do I use a foot pedal with my mac?

    how do I use a foot pedal with my mac to use on YouTube?

    Can you be more specific? What kind of foot pedal? What is the foot pedal used for?

  • How do i use a new computer with my ipod?

    how do i use a new computer with my ipod?

    See this apple support communities user tip…
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive

Maybe you are looking for