View Full Version : Dynamic Actions for Dynamic Movie Clips??
Dravos
November 2nd, 2002, 04:58 AM
I know that you can do for example onClipEvent(enterFrame) as an action for an exisiting movie clip.
How do i dynamically do this
I load the movie:
_root.createEmptyMovieClip("myMovieClip", 101);
myMovieClip._x=50;
myMovieClip._y=50;
loadMovie("image1.jpg", myMovieClip);
and i thought
myMovieClip.onClipEvent(enterFrame){
this._x+=10;
}
why wont this work and if not how can i do this?
Thanx
Dravos
h88
November 2nd, 2002, 05:14 AM
what version of flash ur using!
Dravos
November 2nd, 2002, 05:29 AM
Sorry, Im using Flash MX, thats why i can dynamically load the jpg to the movie clip. but seeming as you can not see it on stage as you create it on entering frame how can i apply this action to it?
h88
November 2nd, 2002, 05:38 AM
it will be something:
movieclip.onEnterFrame = function () {
// ur code over here
}
hope that helps u,
yours,
Dravos
November 2nd, 2002, 05:47 AM
I tried that as well, still no movement :(
h88
November 2nd, 2002, 05:52 AM
can u post ur code, just want to check, cuz that one should work though!
cheers!
h88
November 2nd, 2002, 05:59 AM
man i just tested it, WORKING!!!
_root.createEmptyMovieClip("myMovieClip", 101);
myMovieClip._x=50;
myMovieClip._y=50;
loadMovie("image1.jpg", myMovieClip);
myMovieClip.onEnterFrame = function () {
this._x+=10;
}
hope that what were you thinking about! =)
yours,
Dravos
November 2nd, 2002, 06:05 AM
That is in fact exactly what i want, but i just copied and paster your code ovre mine and it still not working??? If it works on yours is it possible i have some setting turned off??????
my image doesnt move.....
Dravos
November 2nd, 2002, 06:21 AM
Ok get this, i tried a demo and its a movie clip with a actionscripted box, when i do it with that it moves, but if its with the jpg it dont.... Some setting wrong or i need an update/patch??? very confused.
h88
November 2nd, 2002, 06:27 AM
YES, its now worrking :D!!!
_root.createEmptyMovieClip("myMovieClip", 1);
myMovieClip._x=100;
myMovieClip._y=100;
loadMovie("image1.jpg", myMovieClip);
_root.onEnterFrame = function () {
myMovieClip._x+=10;
}
yours,
Dravos
November 2nd, 2002, 06:30 AM
ok that works, cool
erm dare i ask for more help
why will this not work ??
_root.createEmptyMovieClip("myMovieClip", 1);
myMovieClip._x=100;
myMovieClip._y=100;
loadMovie("image1.jpg", myMovieClip);
myMovieClip.onRollOver= function(){
this._x+=10;
}
Dravos
November 2nd, 2002, 06:34 AM
it works if i draw a box as a movieclip
<HR>
_root.createEmptyMovieClip("button1", 100);
button1.lineStyle(2, 0x000000, 100);
button1.beginFill(0xFF0000, 100);
button1.moveTo(-25, -10);
button1.lineTo(25, -10);
button1.lineTo(25, 10);
button1.lineTo(-25, 10);
button1.endFill(-25, -10);
button1._x=i*60;
button1._y=25;
button1.onRollover=function(){
this._x+=10;
}
button1.onRollover=function(){
this._x+=10;
}
<HR>
but not as a jpg again :(
h88
November 2nd, 2002, 06:36 AM
this would!
_root.createEmptyMovieClip("myMovieClip", 1);
myMovieClip._x=100;
myMovieClip._y=100;
loadMovie("image1.jpg", myMovieClip);
_root.onEnterFrame = function () {
myMovieClip.onRollOver= function(){
this._x+=10;
}
}
yours,
h88
November 2nd, 2002, 06:38 AM
i assume the previous post was what you need!
Dravos
November 2nd, 2002, 06:39 AM
CUNNING!!!!!!!!!! kinda annoying that you need an on enterframe but it works
THANX A LOT FOR YOUR HELP
HAPPY SCRIPTING
DRAVOS
(dravos@talk21.com)
h88
November 2nd, 2002, 06:46 AM
glad it worked!=)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.