-
Loading movieclip from library with actionscript
Hey guys.
-I need to load a movie clip to the stage from the library.
-I also need that movie clip to load with a certain string of actionscript code in it.
To load the movie clip, i checked the "export for actionscript" thing in the "linkage" section of the movie clip info, and i named the class "sol1"
I then used this code on the first (and only) frame:
Code:
_root.attachMovie("sol1", "NewInstanceName", {_x: 50, _y: 100});
It seems to work, but the question is, how do i load the movie clip with code in it?
thanks in advance
-
What kind of code do you want to load with it?
Is there a reason you can't include the code in the movie clip in the library?
-
 Originally Posted by RESlyder
What kind of code do you want to load with it?
Is there a reason you can't include the code in the movie clip in the library?
the code i want to have in this object is extremely simple:
Code:
onClipEvent(enterFrame){
this._x+= 5
}
i didnt think it was relevant.
***EDIT***
Sorry i misunderstood what you were saying until i read it again...
And thanks, that totally worked!
I don't know why I didn't even think of that, and I feel really stupid >.<
Last edited by Ffatty; 01-19-2011 at 03:16 AM.
Reason: thanks!!
-
No problem! That is why these forums are here! Glad it worked out
Tags for this Thread
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
|