A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Event dispatch in external swf not being registered in main swf

  1. #1
    Senior Member
    Join Date
    Oct 2005
    Posts
    198

    Event dispatch in external swf not being registered in main swf

    Hi,

    I have an external swf, which runs in the main swf and when it gets to the end of it's timeline I have it fire off an event dispatch..but the main swf doesnt seem to be listening...if it was it should advance 1 frame on its own timeline...Here is my code:

    Code:
    //external swf code--end of its timelline
    timelineOver();
    function timelineOver():void{
    	trace("end");
    	stage.dispatchEvent(new Event("advanceTimeline", true));
    //main swf listening code
    public function Mainprogress()
    		{
    			//trace(buttonLabels);
    
    			if (stage)
    			{
    				main = this;
    				main.init();
    			}
    			else
    			{
    				addEventListener(Event.ADDED_TO_STAGE, this.init);
    			}
    
    
    main.addEventListener("advanceTimeline", moveForward);
    private function moveForward():void
    		{
    			main.gotoAndPlay(currentFrame+1);
    			trace(currentFrame+1, "currentFrame and one");
    			removeEventListener("advanceTimeline", moveForward);
    		}
    }
    could someone perhaps post a link on how to do this or post some generic code?

    Thanks,
    ---Yvette
    Last edited by yvillicana; 05-04-2013 at 08:35 PM.

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