|
-
Hi,
Before the attachMovieClip feature was available, if you wanted to use multiple instances of an MC you had to have the MC on the stage to start off with, and then duplicate that MC as needed. This meant that I always ended up with FLAs that had lots of MCs 'hidden' off canvas that were then duplicated as the movie ran.
The attachMovieClip action was added so that MCs could be pulled out of the library and placed onto the stage as when required.
This is a good feature, but if you need to code for onClipEvents (such as 'enterFrame' or 'load') then the code is stored per instance, not with the clip in the library. This means that you cant use the attach clip feature with the MC.
I was wondering how other people were addressing this issue?
I have had to go back to storing a copy of the MC (complete with code to respond to events) on the stage to start off with, then duplicating.
Any thoughts?
Bangers
-
Heck, you got farther than me. I could never find that damn 'Symbol Linkage Properties dialog box' the manual kept talking about but never telling you where it was.
Can you enlighten me?
-
I've "solved" it by embedding movie clips inside a wrapper movie clip. Say you want to have an MC named "ball" have an onClipEvent(load). Put an instance of your "ball" MC inside another MC, let's call it "ballWrapper". Now, you can put your "ball" code in the instance of "ball". You can use "ballWrapper" to instantiate and use as you normally would.
weinerdog, select a movie clip in the library window. Select "options" in the upper right corner of the window. Under that menu will be the "linkage" option.
-
Casino,
Yeah, I did think of this. But doesn't this mean that if your 'ball' MC wants to move itself, perhaps every frame using onClipEvent(enterframe), then you cant just use the _x, _y properites of the ball MC, instead you have to use _parent._x and _parent._y to move
bangers
-
I have been wondering about this too. I would have been easier if you could put the onClipEvent inside the properties of a smart clip.
I like the wrapper-clip idea, but i think you end up with too much wrappers.
With this all i have an other question. In flash4 it was adviced not to let a clip loop (between two frames). But this onClipEvent(enterframe) or (mouseMove) are the not much like a loop? And taking up memory and speed. What happens if (almost) clip use these events?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|