A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How do I communicate between AS3 and embedded AS2?

  1. #1

    How do I communicate between AS3 and embedded AS2?

    I'm working on a game where the the engine is made in AS3, yet the interface is made in AS2.

    Basically I am embedding the GUI as a AS2 .swf into my main AS3 .swf. I want the AS2 GUI to be able to communicate with it's parent. Small Interface calls like Pause, Unpause, Upgrade...

    I tried to use External Interface, but I can't seem to get it to work. I know it's made for Javascript, but I thought that it would work just as well with AS2 to AS3.

    I'm able to edit the Interface file and have the FLA for it. It'd just be a real pain converting it... It'd take way to long to convert the FLA to AS3, talking weeks here, it's rather large.

    Thanks,

    TariqM

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I made an example for you to send data from AS2 movie to AS3 movie. View source of the html.
    http://flashscript.biz/flashas3/cros...crosstalk.html
    Last edited by cancerinform; 03-02-2009 at 02:47 PM.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Thanks for the example cancerinform!

    But would this work if I download the movie and play it using the Flash Player virtual machine program?

    I noticed that it uses Javascript somewhat.

    Because I want the game to be playable if someone downloads it, copies it to their website, playable using the Flash Player and practically playable anywhere.

    Edit:
    I just tested it and it dosn't seem to work separately. I suspected that since it needed the JS function to intermediate between the two movies. Just seems like there should be an easier way...
    Last edited by tariqm; 03-01-2009 at 04:31 PM.

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You can only communicate from an AS2 to a AS3 movie using server side scripts or javascript. Also this works only online and not on the computer.
    - The right of the People to create Flash movies shall not be infringed. -

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