PDA

View Full Version : Properties + duplicateMovieClip question


friz2002
09-27-2002, 07:40 PM
Hi,

1) Properties question
-----------------------------
I made a movieclip that follows the mouse + 2 dynamic text fields that show the x and y position of the mc.
The strange thing is that the x position goes from 409 to 409.95 instead of 410 in the dynamic text field :confused:
This is when I publish the file.
When I test it in FlashMX this happens too, but from 110 to 110.95. And also in the ypos from 322 to 322.95 :confused:

example + fla (http://uk.geocities.com/chris_vigier/properties_problem.html)

Is this a bug? Am I doing something wrong?

2) dupicateMovieClip question
--------------------------------------
I made a simple mc. on rollOver it makes a copy (x=20)
No problem so far, but when I put my mouse over the copy it moves on top of the original mc ???
How can I prevent this from happening?
example + fla (http://uk.geocities.com/chris_vigier/dupicate_problem.html)

thx

jimburton
09-28-2002, 07:31 PM
re 2, use attachMovie instead of duplicateMovie, then the attached one won't have the rollover method that the original does...? Don't know if that will fix it cos haven't looked at the code...hope so :)

red penguin
09-30-2002, 07:35 AM
As for question #1: Do you wish to see 410 instead of 409.95? The values are the actual values there, comrade. If you want to, you can use Math.ceil(_root.myClip._x) or Math.floor(_root.myClip._x) to get the value you want...

friz2002
10-01-2002, 12:18 PM
Red penguin:
I just didn't understand why the values went from 1, 2, 3, ..., 407, 408 to 409.95, 410.95,...
but the math.ceil -thing seems to solve that problem. Thx

Jim:
thx for you answer. I'm a newbie and I don't know how to use attachMovie yet. So I can't test it for now.
I used this code on the button in the movieclip

on (rollOver) {
_root.shape_mc.duplicateMovieClip("copy_mc",1);
_root.copy_mc._x = 20;
};

now I use this code on the main timeline and this seems to solve the problem:

shape_mc.shape_btn.onRollOver = function(){
_root.shape_mc.duplicateMovieClip("copy_mc",1);
_root.copy_mc._x = 60;
};

Thx everyone for the answers ;)