Dynamic Actions for Dynamic Movie Clips?

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

what version of flash ur using!

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?

it will be something:

movieclip.onEnterFrame = function () {
// ur code over here
}

hope that helps u,

yours,

I tried that as well, still no movement :frowning:

can u post ur code, just want to check, cuz that one should work though!

cheers!

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,

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…

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.

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,

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;
}

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 :frowning:

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,

i assume the previous post was what you need!

CUNNING!!! kinda annoying that you need an on enterframe but it works

THANX A LOT FOR YOUR HELP

HAPPY SCRIPTING

DRAVOS

([email protected])

glad it worked!=)