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);

Similar Messages

  • 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().

  • Migrate existing code of AS3 to AS2 - URLRequest, URLLoader

    Hi,
    I have written code to read an XML file by using URLRequest and URLLoader in ActionScript 3.0. Code is pasted below. This runs well in AS3.  Problem I am facing is because I wrote this in AS3, I am not able to use the DateChooser component in another part of the flash module because it seems like DateChooser component is not supported in AS3. So I want to migrate my below AS3 code back to AS2.
    **** Code in AS3 (I need help in writing equivalent code in AS2) :-
    var xmlText:XML ;
    var xmlReq:URLRequest = new URLRequest("myFile.xml");
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(xmlReq);
    xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
    function xmlLoaded(event:Event):void
        xmlText = new XML(xmlLoader.data);  
        info_txt.htmlText = xmlText.someTag ;
    **** I cannot use the above as is because, when I change the publish settings from AS3 to AS2, I get following errors -
    The class or interface 'URLRequest' could not be loaded.
    The class or interface 'URLLoader' could not be loaded.
    The class or interface 'Event' could not be loaded.
    Same works well in AS3. What should I do to make this work in AS2 or can anyone direct me in writing an equivalent in AS2.
    Please assist.
    Thanks in advance.
    MG

    parsing is done using the xmlnode methods and properties.  how you parse an xml file (in as2) depends on its structure.  but generally, you use firstChild, nextSibling, childNodes and nodeValue in the appropriate sequence to extact data.  the flash help files have sample code.  for tutorials, check google.
    if you're trying to load a cross-domain xml file, you'll have a cross-domain security issue to deal with.

  • Cannot change Tax Code from the referenced sales order line

    hi,
    Has anyone ever got this error when creating Sales Order(SO): "*cannot change Tax Code from the referenced sales order line*"?
    The error occur with order type Return.
    This SO is created by copying from another SO.
    Please help.
    Regards & thanks,
    eRie

    hi,
    Has anyone ever got this error when creating Sales Order(SO): "*cannot change Tax Code from the referenced sales order line*"?
    The error occur with order type Return.
    This SO is created by copying from another SO.
    Please help.
    Regards & thanks,
    eRie

  • HT201263 If yor phone is lost how do you change lock code from computer?

    If your phone is lost how do you change lock code from computer?

    You cannot remotely change the lock code

  • XML queries... Change the code from using Oracle db into MS SQL

    Hi, I am a new begginer in this field. I came accross to an article that focuses in Oracle's XSU approach.
    Currently, i am trying to convert the java code from using Oracle db to MSSQL db. The code has shown below:
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    import oracle.xml.sql.query.*;
    public class testxml
         public static void main(String args[]) throws SQLException, NamingException
         String tabName = "emp";
         int maxRows = 3;
         Context ctx = new InitialContext ();
         DataSource ds = (DataSource) ctx.lookup ("MyOra");
         Connection conn = ds.getConnection ();
    OracleXMLQuery qu = new OracleXMLQuery (
    conn, "select EMPNO, ENAME from " + tabName);
    qu.setMaxRows (maxRows);
    qu.setRowsetTag ("EMPLOYERS");
    qu.setRowTag ("PERSON");
    String xmlString = qu.getXMLString();
    System.out.println (xmlString);
    conn.close ();
    Currently, i am having difficulties to change the "bold" area that uses Oracle into MS SQL as my current application is using MS SQL as the database.
    Please help and need more advices from all of you. Thank You

    I resolved this issue myself. For the answer please message me.

  • HT4113 my iphone has been stolen by my ex who had the 4 digit passcode. Can I change that code from a computer?

    my very bogish ex stole my iphone 5 but knew my 4 digit unlock passcode...is there any way possible for me to change that password from my computer?

    No, there's not.

  • Need help to change some code

    Hi Experts,
    I am new to Java and i struck up in some java code. could some one modify the code according to my requirement please..
    we hava a booking form contains the details like Destination ware house no, load number,PO number, line number.... When the supplier submit the form,Here we should reject the booking form .
    The booking form should reject in some cases where i have mentioned below. accordingly could some one modify the java code please..
    We have to reject such a booking form through the logic
    If Destination Warehouse = Different AND Load number = Common then
    “Reject the booking form”
    Else if
    Destination Warehouse = Different AND Load number = Different then
    "Pass the Booking form"
    Else If
    If Destination Warehouse = Common AND (Load number = Common OR Load number = Different)
    “Pass the booking form”
    Else
    it should Reject the form for different site on same load.
    The java code has been written like this. could someone modify it according to my requirement as i am new to Beginner to Java
    String[] vendor = new String[status.length];
    String[] load = new String[status.length]; //array of load numbers
    String[] site = new String[status.length]; // array of site (dest wh) numbers
    String[] temp = new String[20];
    String[] lstatus = status;
    String[] fail_loads = new String[status.length];
    String[] fail_sites = new String[status.length];
    MappingTrace trace = container.getTrace();
    trace.addInfo("No. of records: " + status.length);
    for(int i=0;i<status.length;i++){
    result.addValue(status);
    try{
    if (status.length != 1) {
    //Split input into Load Number and Vendor Number
    for (int i = 0; i < status.length; i++) {
    temp = status[i].split(":");
    load[i] = temp[1];
    site[i] = temp[5];
    if (temp[2].equals("9999999999")) vendor[i] = null;
    else vendor[i] = temp[2];
    temp = null;
    //Get Loads with two or more vendors
    String p_vendor = vendor[0];
    String p_load = load[0];
    String p_site = site[0];
    int idx = 0;
    int idxs = 0;
    trace.addInfo("Load Length: " + load.length);
    for (int i = 1; i < load.length; i++) {
    if (vendor[i] != null) {
    if (p_vendor != null && load[i].equals(p_load) && !load[i].equals("00")) { //same load as previous
    if (!vendor[i].equals(p_vendor)) { //second vendor in same load
    fail_loads[idx] = load[i];
    idx = idx + 1;
    if (!site[i].equals(p_site)) { //second site in same load
    fail_sites[idxs] = load[i];
    idxs = idxs + 1;
    p_load = load[i];
    p_vendor = vendor[i];
    p_site = site[i];
    trace.addInfo("For Loop 2: Index: " + i);
    trace.addInfo("fail Loads length: " + fail_loads.length);
    trace.addInfo("fail Sites length: " + fail_sites.length);
    //Set values in array Status[]
    for (int i = 0; i < status.length; i++) {
    for (int j = 0; j < fail_loads.length; j++)
    if (load[i].equals(fail_loads[j])) {
    //set status[i] to fail
    trace.addInfo("status[" + i + "] = " + status[i]);
    String msg = "fail" + status[i].substring(4);
    if (msg.length() <= 30)
    msg += ":999";
    status[i] = msg;
    trace.addInfo("status[" + i + "] = " + status[i]);
    break;
    for (int j = 0; j < fail_sites.length; j++)
    if (load[i].equals(fail_sites[j])) {
    //set status[i] to fail
    trace.addInfo("status[" + i + "] = " + status[i]);
    String msg = "fail" + status[i].substring(4);
    if (msg.length() <= 30)
    msg += ":998";
    status[i] = msg;
    trace.addInfo("status[" + i + "] = " + status[i]);
    break;
    result.addValue(status[i]);
    }// end for i
    }//endif
    else
    result.addValue(status[0]);
    }//end try
    catch (Exception e)
    StringWriter stringWritter = new StringWriter();
    PrintWriter printWritter = new PrintWriter(stringWritter, true);
    e.printStackTrace(printWritter);
    String error = "Exception: "
    + stringWritter.toString();
    trace.addInfo("This is exception: " + e.getStackTrace());
    Thanks,
    Suesh

    990094 wrote:
    I am new to Java and i struck up in some java code. could some one modify the code according to my requirement please..No. Ask for help so YOU can change it and learn from it, don't flat out ask other people to do it for you. People will just assume you'll be the one flipping their burgers in the future if you do that.
    new to JavaThere is a forum that has this exact name, I suggest you take your further questions (not requests to outsource work) there.

  • 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.

  • Contribute CS3 seems to change some code?

    I'm new to Contribute and am performing some testing before
    coaching a client through the process. I have just edited a page on
    a test site and when I publish the changes, Contribute seems to
    have converted some Google analytics code that I have placed at the
    bottom of the page creating a small bit of visible code on the page
    and possibly affecting it's function. Any ideas about what's going
    on here? (
    http://salessolutionsusa.com/dev/)

    Please check out this post:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=55&catid=290&threadid =1387669&highlight_key=y&keyword1=google%20analytics

  • Change some mail from one computer to anothe

    I hope that some one can help this old man (81) I am trying to send some mail (inbox) from my G4 QuickSilver 2002 (OS X 4..1 to my lap top G4 PowerBook 17" OS X 4.1.1 and still keep what mail I have on the PowerBook, than send what I am missing from the PowerBook to the QuickSilver 2002.
    I have gone into the ~/Library/mail on both computers but am unable to find any that mach up with what I have on either computers, have also looked in Root/library/mail and no luck there.
    The reason I need this is that I will be bedridden soon and I have a hook up from the QuickSilver to my PowerBook
    I hope that I haven't confuse any one wirh the above information.
    Thank for you for all your time and trouble and have a good day, Any day I wake up and see the sun is a good day for me.

    Hi Norbert, sorry to hear about the "bedridden", I hope it's temporary!
    Make a copy of this folder on each computer, then transfer to the other one...
    ~/Library/Mail
    Ten in Mail>File>Import>from Mail for OSX, click continue, then select that whole Mail copy folder, click choose, give it a bit and it should show you all your Mailboxes to choose which you want to import.

  • AppInsight 5.0 change license code from Trial

    Hello All,
    I've downloaded AppInsight 5.0 trial version, installed, tried and showed to my customer.
    Now my customer want using AppInsight and gave me license code for upgrade to full version ... where i write this code???
    I just read all documetation and searched in discussion forum for changing this license, but unsuccesful ... I'm afraid that product are going to expire ...
    Thanks

    Hello solved!
    AppInsight licenses are managed in the vCenter License manage module so it depends on vCenter 4.1 licensing feature.
    All licensing is then managed via vCenter's Licensing management module toeghether all other licenses:
    Licensing -> Manage VSphere Licenses -> Add License Keys ...

  • How to change company code from notifications ??

    Our company code has changed so now I have to change all the notifications accordingly. we use notifications to register our issues for the customer.
    what are the options to change everything to the new company code ?
    Message was edited by:
            A. de Smidt

    Hello,
    as far as I can see you can check the following tables:
    QMEL
    QMIH
    QMSM
    QMFE
    QMUR
    QMMA
    I am not quite sure what kind of notifications are involved the easiest way to find the correspondent notifications is by using QMEL-QMART for the selection which is the notification type used.
    If you could specify what you mean with company code, I could possibly be able to offer you more information.
    Regards,
    Isabelle

  • Using "Rebuild" changes some messages from READ to UNREAD?

    I'm trying to get my Mail storage in order and read that using Mailbox>Rebuild would be a good step to fix any indexing problems. All goes swimmingly, or so it seems. Save for not being able to rebuild multiple folders at once, that is!
    In any event, on each folder I rebuild several messages switch from READ status to UNREAD. This happens on both POP and IMAP accounts.
    So I go through and actually read them in one mailbox. And in another I select all and use Mark>As Read on them.
    Looks good, so I try a rebuild again. And the same messages show up as UNREAD again.
    Right, next try is to get them marked as READ, as above, and quit Mail, then reopen it. The messages still appear as read, so I try REBUILD again. And... the same messages flip back to being UNREAD.
    Anyone know what's going on? And perhaps how to fix it?
    Thanks!
    MacBook Pro 15" 2.16GHz / 2GB / 160GB Mac OS X (10.4.9)
      Mac OS X (10.4.9)  

    Sounds like there is a problem with the Envelope Index file which stores an index of all mailboxes and messages for Tiger Mail.
    Quit Mail first and using the Finder go to Home > Library > Mail. Copy the Mail folder and place the copy on your Desktop or on a backup drive for backup purposes.
    Using the Finder, go to Home > Library > Mail > Envelope Index. Delete the Envelope Index file and empty the Trash.
    Launch Mail and you will be prompted to import mailboxes. Select OK and allow this process to complete. This isn't really importing anything but is replacing the deleted Envelope Index file and reindexing all mailboxes and messages.
    Test if this resolves the problem. After confirming all mailboxes and messages are available, you can delete the copy of the Mail folder created for backup purposes.

  • Converting AS3 to AS2

    Does anyone know how to translate this code into AS2? My client can't support AS3.
    var exitTimer:Timer = new Timer(15000, 1);
    exitTimer.addListener(TimerEvent.TIMER, jump);
    function jump(event:TimerEvent):void {
        gotoAndStop("Scene 1")
    exitTimer.start();
    Thank you!

    I put the wrong script in. This is the one I'm trying to convert from AS3 to AS2. Do I still use the setTimeout function or is the getTimer function more appropriate?
    var exitTimer:Timer = new Timer(15000, 1);
    exitTimer.addListener(TimerEvent.TIMER, jump);
    function jump(event:TimerEvent):void {
        navigateToURL(new URLRequest("http://www.url.com"));
    exitTimer.start();

Maybe you are looking for

  • Multiple devices on account

    I have one apple id & itunes account for my daughter & myself. However since the latest update she is getting all my facebook contacts. How do correct this?

  • How to start with Idocs??

    Hi, I am a novice in sap. Can you please guide me how to start working with IDocs?? I know the basics about ale, edi, message type, idoc type and transactions associated with it. Essentially, Can I have sample problems to practice IDocs so that i cou

  • Why did Lightroom add folders to my structure ... ?

    Hi there, I have this irritating problem when I wanna add photos from my SD card. I chose the COPY function and then chose/instruct Lightroom to copy all the selected files to my Dorbo harddisk as this link: Drobo > Photos > Birthday But instead, Lig

  • Comparing 2 hierarchies in oracle

    How to compare 2 hierarchies in oracle. if there are any analytical functions please share to me.

  • What is a Mac Pro? Is it a computer?

    What is a Mac Pro? Is it a computer?