A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Need help with importing and creating a class

  1. #1
    Senior Member
    Join Date
    Sep 2002
    Location
    Clogland
    Posts
    100

    [RESOLVED] Need help with importing and creating a class

    Howdy, I'm almost there....

    This is working

    PHP Code:
    import flash.external.*;
    test.onRelease = function():Void{
        
    ExternalInterface.call("html_alert");

    .....but i would like to put it into a class, something like....

    PHP Code:
    class Test extends MovieClip{
       function 
    Test(){
          
    this.onRelease = function():Void{
            
    ExternalInterface.call("html_alert");
            }
        }

    That however will give this error message...

    PHP Code:
    There is no method with the name 'ExternalInterface'.
                     
    ExternalInterface.call("html_alert"); 
    Can anyone tell me which step I need to add to get this one up and going? Pretty sure I have to inherit the properties of the ExternalInterface class somehow, but I'm going around in circles here.

    Thanks in advance.

  2. #2
    Senior Member
    Join Date
    Sep 2002
    Location
    Clogland
    Posts
    100
    Simplest solution ever ( always seems to happen after posting a cry for help )...

    ..needed to add the import statment to the Test.as class file, do'h.

    PHP Code:
     import flash.external.*;
    class 
    Test extends MovieClip{
       function 
    Test(){
          
    this.onRelease = function():Void{
            
    ExternalInterface.call("html_alert");
            }
        }


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