A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: AS2 with AS3

  1. #1
    Member
    Join Date
    Oct 2006
    Posts
    36

    AS2 with AS3

    I was just wondering. I am going through a lot of grief trying to change my AS2 code to AS3 simply because I need to use one tiny little functionality which is in AS3 but not in AS2.

    So, quick question. Since Flash player 9 also can understand AS2, is it not possible to somehow merge my AS2 with the small line of AS3 that i need and have the player read the two codes correctly.

    Maybe its silly question.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You can load Movies, which have AS2 code into movies with AS3 code, but you can't communicate with them. You cannot mix both in one movie.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    you can communicate, but only through local connection, not mixing code (no direct AS2 -> AS3 talk or vise versa)

  4. #4
    Member
    Join Date
    Oct 2006
    Posts
    36
    bummer..... so i have to change 1000 lines of my entire AS2 code just because i need one line of AS3 code .....

    The AS3 code would need to feed the AS2 with variables. What a disappointment. I cant believe Adobe went and change Actionscript so much... it is a completely different language...

  5. #5
    Member
    Join Date
    Oct 2006
    Posts
    36
    Senocular, please explain further.... you might save me on this one ...

  6. #6
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    Quote Originally Posted by 0gani
    bummer..... so i have to change 1000 lines of my entire AS2 code just because i need one line of AS3 code .....

    The AS3 code would need to feed the AS2 with variables. What a disappointment. I cant believe Adobe went and change Actionscript so much... it is a completely different language...
    Yes, it is. But like you said, there was something you wanted to do in AS2 that you couldnt. The Flash team saw the need for improvement and took the step to make that improvement even at the cost of needing an entirely 'new' language.

  7. #7
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    Quote Originally Posted by 0gani
    Senocular, please explain further.... you might save me on this one ...
    see:
    http://www.kirupa.com/forum/showthre...50#post1964550

  8. #8
    Member
    Join Date
    Oct 2006
    Posts
    36
    Thank you senocular..... interesting solution....exactly what i am looking for...it will save me a lot of problems...

    Please take a look at this

    http://myoperators.com/useless/hip.swf

    This orange box is the swf with the AS2...
    The white stuff is the AS3 swf.

    I want the orange box to start from the top left corner... I cant figure it out

    Here is the code for the AS3 swf which contains the orange box

    Code:
    import flash.display.*;
    var loader:Loader = new Loader();
    loader.load(new URLRequest("orangebox.swf"));
    addChild(loader);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center