Loader (Need help to convert from AS3 to AS2)

Since I know this code works fine and that I use it into one of my AS3 flash, I need it in one of my AS2 flash and I don't know how to adapt it. I've searched in over 100 threads and I can't find something similar... Thanks to help me get it to work in AS2! Since I need it in AS2, I thought it would be the right place to post it.
I posted all the loading process code, but I would need help mostly with the Loader part. How to do it in AS2? Thanks!
var img = 0;
var image_total = 0;
var myImages_array:Array = new Array();
var myBitmaps_array:Array = new Array();
function Init();
// Images urls are loaded into an array before this call
LoadImage();
function LoadImage()
    if (img < myImages_array.length) // img is the current image index and myImages_array is my array of URLs
// I need help with this part please
        var loader:Loader = new Loader();
// returns the image full path and load it
        loader.load(new URLRequest(my_site_url + myImages_array[img]));
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
    else
        if (count == 0)
// When everything's loaded, I'll start loading my Bitmaps into a small slideshow
            count += 1;
            init_slideshow();
function imageLoaded(e:Event):void
    var image:Bitmap = e.target.content;
// Bitmap manipulation here (removed)
    image_total = myBitmaps_array.push(image);
    if (img < myImages_array.length)
        img += 1;
// Call next image
        LoadImage();
function init_slideshow():void
// Reserts the current index for the first one
    img = 0;
// Start the slideshow since everything's loaded
    animate_slideshow();

If you look at the Flash help documentation for the addListener metod of the MovieClipLoader class, there is an erxample there that you should hopefully be able to work from.  It will be better if you get your stuff coded into AS2 before you pursue more help with it.  IT is difficult to tell you how to fix something if you don't show what you are using.

Similar Messages

  • Need Help! Converting from C#

    Whats Up guys!
    So, could anybody help me to convert these 2 functions written on C# into Java.
    public static System.IO.Stream readResource (String name) {
              System.Reflection.Assembly
                   thisAssembly = typeof (AU).Assembly;
              String
                   assemblyName = thisAssembly.GetName().Name.ToString();
              System.IO.Stream
                   stream = thisAssembly.GetManifestResourceStream (assemblyName +"."+ name);
              return stream;
    public static String readResourceString (String name) {
              String
                   result = new System.IO.StreamReader (readResource (name)).ReadToEnd ();
              return result;
         }Best Regards, Dimon.

    http://java.sun.com/docs/books/tutorial/reflect/index.html
    http://java.sun.com/docs/books/tutorial/essential/io/index.html
    http://www.rentacoder.com

  • Need help in converting date format

    Hi,
    Need help in converting date format from 'DD-MON-YYYY' to 'YYYY-MM-DD' in an .rtf template as I believe xml publisher supports the date format as 'YYYY-MM-DD' only.
    Thanks,
    Raj.

    I got the same problem, anyone know how to solve this problem? I allready found some date functions on http://blogs.oracle.com/xmlpublisher/2008/09/date_functions.html . I also tried <?xdoxslt:month_name(xdoxslt:get_month(xdofx:substr(NEED_BY_DATE, 4,3)), $_XDOLOCALE), 0, 'nl-NL')?>, but then it returns a namespace error (Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.). Anyone know how to fix this?
    Edited by: user11165753 on 7-dec-2009 23:50

  • How do you convert this code from AS3 to AS2?

    Hi,
    I created some AS3 code that is working perfectly for us.
    However now we need to convert it to AS2 so that it can be Flash
    Player 8 compatible. If it could also be compatible for Flash
    Player 7 that would be ideal but not a requirement.
    Thanks in advance.

    Are you wanting someone to do the conversion for you, or are
    you asking for general tips for doing the conversion yourself?
    i can give you tips:
    have a look at the
    ActionScript
    2.0 Migration page.
    In this you'll find the property conversions eg(going from
    AS3 to AS2). y becomes _y, height becomes _height, scaleX becomes
    _xscale, void becomes Void etc.
    you'll find that events need to be converted, eg.
    particle.addEventListener(Event.ENTER_FRAME,
    animateParticle);
    becomes:
    particle.onEnterFrame=animateParticle;
    the onEnterFrame class doesn't pass an Event parameter to the
    event listener. Instead, the event listener is automatically in the
    scope of the event dispatcher, so instead of 'event.target' you
    will be able to just target 'this'.
    You'll need to use setInterval() instead of the Timer class.
    You'll need to use attachMovie() instead of
    addChild().

  • Need help coping project from one computer to another.

    I need help coping project from one computer to another.  I loaded all video on computer 1, copied events and project folder to computer 2.  I was told I only needed to copy the project folder back to computer 1 since the events folder is already there.   I copied project folder back to computer 1 but the files wont open.  I dont have computer 2 available. 
    Please help!!!

    Hi
    No that's not the way to do it - iMovie gets confused and in some cases the problems might be un-repairable.
    You've got several problems
    • iMovie'08 - CAN NOT MOVE PROJCTS - You NEED iMovie'09 or iMovie'11 - I see no other working solution
    • Never MOVE or alter any folder named
    iMovie Projects - or -
    iMovie Events
    on DeskTop/Finder - This might be very harmful
    • Moving (Projects) and Events - HAS TO be done within the iMovie Application.
    You've got an Evets window and here You can view Your Events in two ways - Yearly - or - Yearly per Hard disk
    Here You can move within this "window" to another location
    • Projects - NO they do not contain Your full movie - only a document on howto use the material in Event folder
    and there might be worse if You added Photos from iPhoto and Audio from iTunes/Garageband - then You have
    to get this over to the second Mac too, to be able to continue editing.
    So to move Your projects to another Mac You need
    • iMovie'09 or 11
    • an external hard disk -
    MUST BE Mac OS Extended formatted - as UNIX/DOS/FAT32/Mac OS Exchange will not work for VIDEO
    Should be a FireWire one - as UBS/UBS2 performs badly when used for video
    • Then move/copy over within Project resp Events window in iMovie Application
    Hopefully I've been not to confusing or badly structured to be followed.
    Yours Bengt W

  • I need help in converting a pdf to a fillable form in my adobe

    I need help in converting a pdf to a fillable form in my adobe

    "Adobe" is a company. If you mean "Adobe Reader" then you can't (at least not easily). You need Adobe Acrobat for that.

  • Need help in converting numbers to Italian text

    Need help in converting numbers to text in Italian language. I want to knw is there any method other than SE63 to translate these text in one shot. I have tried with LSMW also (as the sheet is in XLS format ).Plz reply if anyone is aware of this ..

    hi,
    chk this code.
    CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
    amount = amount
    currency = 'EUR'
    filler = ' '
    language = 'E'  => give the language as italian
    IMPORTING
    in_words = amountrs.
    rgds
    anver
    pls mark all hlpful answers

  • TS1389 I need help removing UAC from itunes..

    I need help removing UAC from itunes so it will not allow me to open itunes. Everything I have read from other comments that you shouldn't turn off your user account control. I just to be able to open itunes. Can anyone help me with this problem?? Greg, ogrady612@yahoo,com

    I had this problem too but you do not need UAC to be turned on.
    Click on start and search for 'uac' in the search box at the bottom and click on 'Change User Account Control Settings' when it comes up. Move the slider to the bottom when the window appears and save the changes and your done!
    It's worked for me and my uac has been off for months without causing me any problems!
    Hope this helped

  • WHO CAN/WILL HELP ME CONVERT FROM PDF TO WORD ?

    WHO CAN/WILL HELP ME CONVERT FROM PDF TO WORD ?

    Someone might. Are you having a problem? What have you purchased from Adobe, exactly, and where do you get stuck?

  • I need help removing CS3 from Windows 7 so I can reinstall

    I need help removing CS3 from Windows 7 so I can reinstall

    Before trying to remove try re-installing CS3 right on top of the current install.  Often re-installing Photoshop on top of itself fixes the install.  If it does be sure to apply the cs3 updates.
    Download Adobe CS4 and CS3 Free Trials Here (incl. After Effects) | ProDesignTools
    your product key can be retrieved from here https://www.adobe.com/account/my-products-services.html
    use these links for the updates.
    Adobe - Photoshop : For Macintosh
    Adobe - Photoshop : For Windows

  • Please i need help with switch from the us store to malaysian store how i can switch

    Please i need help with switch from the us store to malaysian store how i can switch

    Click here and follow the instructions to change the iTunes Store country.
    (82303)

  • Change some code from as3 to as2

    Hi, I want to use as2 because it compatible with my website.
    I want to change some code from as3 to as2
    /////////////////////////////image1//////////////////////////////// if(MovieClip(this.parent).imagetxt.text == "a") {     var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";     var myrequest:URL = new URL(imgurl);     myloader.scaleContent = true;     myloader.load(myrequest); } /////////////////////////////image2//////////////////////////////// else if(MovieClip(this.parent).imagetxt.text == "b") {     var imgurl2:String = "http://aloflash.com/images/upload/3.jpg";     var myrequest2:URLRequest = new URLRequest(imgurl2);     myloader.scaleContent = true;     myloader.load(myrequest2); }thank you for your support.

    use:
    var myloader:MovieClip=this.createEmptyMovieClip("loader_mc",this.getNextHighestDepth());
    if (MovieClip(this._parent).imagetxt.text == "a") {
        var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";
        myloader.load(imgurl);
    } else if (MovieClip(this._parent).imagetxt.text == "b") {
        var imgurl2:String = "http://aloflash.com/images/upload/3.jpg
        myloader.load(imgurl2);

  • Need help translating menu from as2 to as3

    Ive been at this for a week now, trying to build a
    straightforward accordian menu, translating an existing as2 menu
    into as3. I desperately need help, I've reach my conceptual ends in
    terms of code knowledge. Could someone please take a look at what
    I've got and what I need to do to get it working? I've included the
    AS3 file I've been working on and well as the AS2 files I've been
    referencing and attempting to translate. Any help really be
    appreciated...also, here is the code I have so far below.

    you have a 4 enterframe loops running continually when they
    only need to run after a menu item has been clicked and can stop
    after all menu items have reached their final positions.
    and you need to compute the final positions for each menu
    item after one of them is clicked.
    you might do better to check for an as3 tutorial for an
    accordian menu. it's a bit more involved than you're thinking.

  • Do I need a wattage converter from US to AU for my Macbook Pro?

    I am traveling to Australia. Will I need a wattage converter for my MacBook pro?
    Going from USA to Australia.
    Please Help and Thanks!

    "although you may need a plug adapter....I do not know what plug type is used in OZ"
    They have them on Amazon.com, not expensive a few dollars

  • I DESPERATLY NEED HELP TRANSFERING SONGS FROM IPOD TO ITUNES LIBRARY

    hi my computer crashed downstairs and i need help moving all my songs from my ipod to my itunes library, on the other computer...will someone please help me?

    Hello Markatkis,
    Make sure your not connecting it to more than one PC. A new iPOd is set to "Auto Update" by default. With this setting all you do is plug the iPOd into the PC and iTUnes automaticly opens, loads all the songs it has listed in iTunes to the iPod, and after its done, ejects the iPOd.
    If you connect it to another PC tho with iTUnes on it you usually get a promtp that in short says "iPOd library linked to another PC, do you want to link to this one" if you click yes, it wipes the iPOd clean and loads only whats on that PC.
    Since your new to all of this a great place for you may be the "iPod 101" site. It will show you all the bacis ropes of using your iPOd, using iTUnes, and using them both together. http://www.apple.com/support/ipod101/

Maybe you are looking for