We help IT Professionals succeed at work.

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

greg7740
greg7740 asked
on
406 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

Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Top Expert 2009

Commented:
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.

Author

Commented:
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.
Top Expert 2009

Commented:
you figured out how to get the ID i assume?

Author

Commented:
yes, thanks Blue Genie.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.