Solved

How do I correct this error, Incorrect number or arguments.

Posted on 2009-06-27
5
355 Views
Last Modified: 2013-11-11
I know I need something in the parenthesis of swfComplete when I run the function.  I've tried everything.

1136: Incorrect number of arguments.  Expected 1.

Thanks.

stop();
var request:URLRequest = new URLRequest("myURL");
var swfLoader:Loader = new Loader();
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfComplete);
var newID = 0;
function swfComplete(e:Event):String {
       MovieClip(swfLoader.content).innerVariable = newID; 
    	   
	return (newID);
	   
	  }
 
	   swfLoader.load(request);
 
swfComplete();

Open in new window

0
Comment
Question by:greg7740
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
mynamebecory2 earned 500 total points
ID: 24730101
If you want to call swfComplete yourself even though you've designed it for an event listener

"swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfComplete);"

you can just call it passing null or a new object of the specified parameter type as long as you're not using anything specifically set automatically in that parameter. That is to say, because you're not using the variable "e" inside your swfComplete function you can call it like this:

swfComplete( null );

or

swfComplete( new Event( "myDummyEvent ) );
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24730310
just to add. why are you calling swfComplete?
seems pointless as mynamebecory said - you've created an event listener - so your swfcomplete will trigger automatically once your swf loader has finished loading.
0
 

Author Comment

by:greg7740
ID: 24731626
I'm new to actionscript and I was trying to use the value of the variable created inside the function.  How would I get the value of newID if I don't call the function.  Thanks.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24743367
you figured out how to get the ID i assume?
0
 

Author Comment

by:greg7740
ID: 24748602
yes, thanks Blue Genie.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question