| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jun 2003
Posts: 30
|
Hi, I'm wondering what's the best way to go about setting up this class.
I basically want a user to be able to create an object and assign a image to. Then the user can create as many textfields as they want for that object. I'm not sure how to associate the new textField to the object. I can have a property for the image, but if the user can make as many textfields as they want, how would I set a property of the textFields for the object? Should I have an array that holds the textFields properties? Here's an example I'm working with: http://www.visualstrategies.ca/forma...omponent05.swf Thanks for the help! |
|
|
|
|
|
#2 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
You could always do something like this:
ActionScript Code:
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jun 2003
Posts: 30
|
Thanks for your help!
I basically took your code and created a class out of it. Here's the class: Code:
class CreateField extends MovieClip {
private var identifier:String;
private var textFields:Object = new Object();
private var tfArray:Array = new Array();
public function CreateField(){
}
public function makeField(fld_name:String, fld_content:String, fld_depth:Number, x_loc:Number, y_Loc:Number ){
identifier = fld_name;
textFields[identifier] = _root.createTextField(identifier, fld_depth, x_loc, y_Loc, 100, 100);
textFields[identifier].text = fld_content;
tfArray.push(textFields[identifier]);
for (var prop in tfArray) {
trace("myObject."+prop+" = "+tfArray[prop]);
}
}
}
Thanks again. |
|
|
|
|
|
#4 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
It's right if it works. The code I posted in an AS 2.0 verion of the AS 3.0 Dictionary class. I don't really know your needs so I'm afraid I can't help too much more.
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#5 |
|
Registered User
Join Date: Jun 2003
Posts: 30
|
Thanks for you help, sorry i didn't reply sooner I've been sick.
Thanks again |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Optimizing Flash Web Sites for Search Engines | rockcoastmedia | General Chat | 20 | 03-29-2009 10:31 PM |
| Flash And Xml question | loach | ActionScript 2.0 | 1 | 05-19-2006 04:17 AM |
| Some Flash Video Converter Tools Compare | terry117 | Detention | 7 | 05-18-2006 03:08 AM |
| Question about a flash game I saw... | MrTip | ActionScript 2.0 | 5 | 04-26-2006 10:55 PM |
| another flash 6 detection question | chilakilez | Simple Stuff (Newbies) | 2 | 12-01-2003 02:11 PM |