A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: I can do this in AS2 but need help in AS3

  1. #1
    Member
    Join Date
    Sep 2006
    Posts
    49

    I can do this in AS2 but need help in AS3

    I'm tying to launch a greybox (http://orangoo.com/labs/GreyBox/) from a Flash file. I've done it loads of times in AS2 with a button script like this:

    Code:
    on (release) {
        getURL("javascript:openBox('FEATURE');");
    }
    But can't figure out how to do the same thing in AS3. Any help is greatly appreciated.

    The working site is here: http://villagegreenstudios.com/view15/ and the button is "Featured Content"

    Thanks.

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    Use ExternalInterface

    Actionscript Code:
    import flash.external.ExternalInterface;
    import flash.events.MouseEvent;
    myButton.addEventListener(MouseEvent.CLICK, onMyButtonClick);

    function onMyButtonClick(event:MouseEvent):void{
      ExternalInterface.call("FEATURE");
    }

  3. #3
    Member
    Join Date
    Sep 2006
    Posts
    49

    Thanks jAQUAN

    That didn't quite do it but it helped me to get close with this:

    import flash.events.MouseEvent;
    import flash.external.ExternalInterface;

    yourButton.addEventListener(MouseEvent.CLICK, click);

    function click(e:MouseEvent):void {
    ExternalInterface.call("openBox", "FEATURED");
    }

    However this still has 2 issues:

    1. In FF (mac) the grey background has no transparency.
    2. In Safari (mac) the video doesn't load.

    Can anyone help with these?

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