Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-03-2010, 08:32 AM   #1
Khorask
Member
 
Join Date: Mar 2010
Posts: 51
Default Passing properties to constructor ?

Beginner question here...

Is it possible to define 'public properties' of an object in the constructor method when you create the object ? similar to..

var leftmain_scrollertext = new TextField({length:10});

I have a TextField and I want to set its maxChars, x, y, width etc.

when I specify one or more of these I get...
1137: Incorrect number of arguments. Expected no more than 0.

am I forced to specify each property I want individually after I have constructed it ?

Thanks
Khorask is offline   Reply With Quote
Old 04-03-2010, 09:40 AM   #2
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,828
Send a message via Skype™ to henke37
Default

The constructor is the one chosing what arguments it takes, not the code instantiating the class. There is no generic method to do what you want to do. Just deal with it.
__________________
Signature: I wrote a pair of articles about the timeline.
henke37 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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:17 AM.

///
Follow actionscriptorg on Twitter

 


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