A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Action Script error 5006

  1. #1
    Senior Member
    Join Date
    Feb 2004
    Posts
    782

    Action Script error 5006

    Trying to import an outside .swc into a .as file but I keep getting this error when using the functions. Here is my code:

    Code:
    package{
    	import flash.geom.*
    	import flash.text.*
    	import flash.display.*;
    	import flash.events.*;
    	import flash.utils.Timer;
    	import flash.media.Sound;
    	import flash.media.SoundChannel;
    	import main;
    	import com.differencegames.dggameapi.events.DGGameEvent;
        import com.differencegames.dggameapi.DGGameAPI;
        //var n:DGGameAPI
       //var t:DGGameEvent
    
       //logDisplay.text="Waiting for API.";
    
       DGGameAPI.create(this.stage,"differencegames.gardendifferences").addEventListener(DGGameEvent.CONTAINER_READY,onApiReady);
       public function onApiReady(e:Event=null):void
       {
    	  //gotoAndPlay(1,"mainmenu");
       }
    5006: An ActionScript file can not have more than one externally visible definition

    Whats the issue?
    Flash Ninja Clan - Games and cartoons

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Your class definition is missing:

    public class Classname
    {
    DGGameAPI.create(this.stage,"differencegames.garde ndifferences").addEventListener(DGGameEvent.CONTAI NER_READY,onApiReady);
    public function onApiReady(e:Event=null):void
    {
    //gotoAndPlay(1,"mainmenu");
    }
    }
    - 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