This content has been marked as final. Show 2 replies
> Hello, I have a simple single frame Movie with one
> MovieClip on stage
Whenever I hear the heard the word "simple" coming from someone with a
question, I run and duck for cover!
> the movieclip has some AS on it and 3 lines of AS
> on the first frame too. Theres nothing else in this movie.
I'll bet a lot depends on exactly what ActionScript is involved. ;)
> BUT, when i goto dublicate this movie in a
> new document by copy and pasting the MC and all
> the AS, the movie doesnt work! How fustrating!
I'll bet! My initial hunch is that you're not *actually* copying *all*
the ActionScript, even though you think you are.
> Please take a look for yourself. The MovieClip should
> avoid contact with the Cursor using "Magic" and
> "Magnit" X-Y physics.
I prefer not to download the file ( ... at least, not yet). But off the
top of my head, avoiding cursor content with "magic" and "magnit" physics
doesn't seem "simple" to me. ;)
I recommend that you double-check your copied version to ensure that
indeed all the ActionScript is copied over -- AND that both documents are
being published to the same version of Flash Player, AND that both documents
are being published to the same version of ActionScript.
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."
hey thanks for replying David.
Ok ive checked its using the same version of AS but I didnt think to check the version of flash player. The original movie is published to Flash Player 6 and my duplicate was published to Player 8. Thanks for clearing this up! Your a genius! :P
But hmm.. Not sure I want to publish this movie in flash 6.. What changes to make AS out of Date?
Heres the AS i was copying over:
setProperty("", _quality, "BEST");
magnet = 100;
magic = 2;
homeX = this._x;
homeY = this._y;
x0 = this._x;
y0 = this._y;
x1 = _root._xmouse;
y1 = _root._ymouse;
distancex = x1 - x0;
distancey = y1 - y0;
distance = Math.sqrt(distancex * distancex + distancey * distancey);
powerx = this._x - distancex / distance * _root.magnet / distance;
powery = this._y - distancey / distance * _root.magnet / distance;
forcex = (forcex + (homex - x0) / 2) / _root.magic;
forcey = (forcey + (homey - y0) / 2) / _root.magic;
this._x = powerx + forcex;
this._y = powery + forcey;