OZONE Asylum
Forums
Multimedia/Animation
coding with MX
This page's ID:
11440
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I'm having a real hard time getting a mental image of what you want to accomplish. Would the graphics be distributed randomly on the stage? Would they all be in a vertical or horizontal line? Would they actually look like "pointers" of some sort? Getting 10 instances of a movie clip on stage is simple with a loop: [code]for (var i=0; i<10; i++){ ..attachMovie code... }[/code] VERY simplified, but I don't want to insult you if you already know this. I could go into more detail if necessary. Each instance would be given a name at the time they were attached; part of that name would most likely be a unique integer, commonly derived either from i or depth: for example "pointer"+i. (tacking on a single digit 0-9 would be simpler than 1-10 when it comes to extracting the digit later, or if you push them into a 0-based array.) Thus each instance could be "aware" of itself and potentially all the others by using a string method such as substring to extract that integer. Depending on how elaborate you need this to be, each clip could contain an array of all the others (see Jared Tarbell's [url=http://www.levitated.net/bones/nodeGarden/]binary networks[/url] composed of self-and-other-aware "nodes"), or just simply know which number was greater that iteslf. Movie clip objects in MX are now capable of receiving mouse evens such as onRelease. If the first clip's initial behavior is to blink until clicked on, and the subsequent clips' behavoir is to not blink until pointed to and then blink until clicked on, that wouldn't be hard. The blink could be a simple frame loop and the onClick function could send the clip to a frame beyond the loop. Getting it to "point" to the next clip would involve some trigonometry if the clips are scattered around the stage. Does this need to be object oriented? No. Could it be? Sure. You could script a "Pointer" class. You could write the class constructor in the timeline of the movie clip and use registerClass so that every instance of the clip created a new instance of the class. That's a lot more work, so give us some more details about what you want to accomplish and maybe we can work out a rational approach. Flash is very flexible compared with java and c++. I'm not a java or c++ programmer, but from what I understand, ActionScript can be initially disorienting for those coming from the stricter languages. ActionScript is considered "loosely typed", and is technically a prototype based language, not a strict class based language. I know a lot more than I did a year ago, but a lot less than I need to know to speak with authority. Still, game for trying. [This message has been edited by Steve (edited 08-19-2003).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »