Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Extensions and Plugins > JSFL - Extending Flash

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-06-2004, 04:50 PM   #1
Go_Cats_Go!
Registered User
 
Join Date: Dec 2003
Location: Cincinnati
Posts: 3
Default Help with JSFL AddNewRectangle

How do I substitute a variable in for the named arguments in the addNewRectangle method of JSFL?

Instead of this:
flash.getDocumentDOM().addNewRectangle({left:0,top :0,right:100,bottom:100},0);
I need to do this:
flash.getDocumentDOM().addNewRectangle({left:myvar[0],top:myvar[1],right:myvar[2],bottom:myvar[3]},0);

I keep getting the message "argument number is not valid". I've tried building the parameter string ahead of time, and I've tried using the eval() function, but still can't get past this error.

Anybody else have any ideas?

Thanks!
Go_Cats_Go! is offline   Reply With Quote
Old 08-17-2004, 05:49 AM   #2
cMan
Registered User
 
Join Date: Apr 2004
Posts: 28
Default

nothing wrong with your code except the way you probably defined your array().

here are 3 ways.

var myvar = [ 0, 0, 100, 100 ];
or
var myvar = new Array();
myvar[0] = 0;
myvar[1] = 0;
myvar[2] = 100;
myvar[3] = 100;
or
var myvar = new Array();
myvar.push( 0 );
myvar.push( 0 );
myvar.push( 100 );
myvar.push( 100 );

------------

any of those 3 ways you choose will work with your code.

flash.getDocumentDOM().addNewRectangle({left:myvar[0],top:myvar[1],right:myvar[2],bottom:myvar[3]},0);
cMan is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:10 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.