Jump to content
GreenSock

UbiAssassin

Another ArgumentError: Error #1063 :/

Recommended Posts

Here is the error that I am getting, even though the chunk of code that is causing it eventually works. It will continue to output the error:

 

ArgumentError: Error #1063: Argument count mismatch on imageLightningMain/initTitleLightning(). Expected 0, got 1.
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.refunk.timeline::TimelineWatcher/watch()

 

Here is the actual class file that is causing the problem:

 

package
{
import com.greensock.loading.display.ContentDisplay;
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.loading.LoaderMax;
import com.refunk.events.TimelineEvent;
import com.refunk.timeline.TimelineWatcher;

public class imageLightningMain extends MovieClip
{

 //========================================================
 //*** Variable declarations for TimeLineWatchers.***
 //
 //========================================================

 private var imageLightningWatcher:TimelineWatcher;
 private var titleLightningMC:ContentDisplay = LoaderMax.getContent("titleLightningmcs.swf");

 public function imageLightningMain()
 {

  //==========================================================================================
  //*** Set up TimeLineEvent and a Watcher that will allow the Title Lightning FX to Run.***
  //*** Function to clean up when the processes are complete.***
  //
  //==========================================================================================

  imageLightningWatcher = new TimelineWatcher(this);
  imageLightningWatcher.addEventListener(TimelineEvent.LABEL_REACHED, initTitleLightning);
 }

 private function initTitleLightning():void
 {
  trace("titleLightning Activated");
  addChildAt(titleLightningMC, 0);
  LoaderMax.getLoader("titleLightningmcs.swf").rawContent.play();
  imageLightningWatcher.removeEventListener(TimelineEvent.LABEL_REACHED, initTitleLightning);
  imageLightningWatcher.dispose();
  imageLightningWatcher = null;
 }

}
}

 

Is there anything about this setup that jumps out to you as incorrect? I cannot seem to find the issue. Thanks!

Link to comment
Share on other sites

due to the fact that you are removing an event listener that triggers initTitleLighting, I'm guessing the problem is that initTitleLighting() isn't set up to accept an event.

 

you probably have to do something like:

 

private function initTitleLightning(event:TimelineEvent):void

 

see if that helps

Link to comment
Share on other sites

Thanks Carl. I actually re-added the (e:TimelineEvent):void. I re-started CS4 and it gave me the real error that I need to debug:

 

TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChild()
at imageLightningMain/initTitleLightning()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.refunk.timeline::TimelineWatcher/watch()

 

This error shows up and the lightning code does not engage at the right time, but after a bit of a delay it starts working as intended. Maybe it is because I am adding this new movie into a movie that it thinks no longer exists. I am using a timeline label on the very last checkpoint of the container movie. There is also a stop(); command on that last checkpoint of the container movie. The label is the timeline event cue that tells the new lightning movie to be added into the container and then start. Could it be since the container movie has reached its final position and stopped, it is considered no longer there for the addChild command?

 

I have another way to fix this issue that I will probably use and it will completely remove the issue of me trying to load the lightning movie into the container. The error-prone method was just a way to circumvent performance issues of having more than two FX bolts present at the same time. I just have to re-write things a bit to correctly time and remove the bolt animations in the container movie to avoid the performance issue and the error listed above. I just would like to know what types of things specifically cause the (TypeError: Error #2007: Parameter child must be non-null.) issue so that I can avoid them in the future.

 

Thanks again!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×