View Full Version : Finding co-ords for attachMovie
simail
03-10-2002, 01:17 AM
i thought mr cool was appropriate for the midnight hour
o wise ones from the east, or is it the west, can you indulge me
one last time tonight?
i need to be able to retrieve the exact co-ordinates for my
attachMovie from the main stage. I got them by trial and error
for the below code but i want the event on the control clip to
position them for me. here goes:
onClipEvent(load) {
pt = new Object();
pt.x = _parent._parent._x = 280;
pt.y = _parent._parent._y = 220;
}
onClipEvent (enterFrame) {
_parent._parent.localToGlobal(pt);
_parent._parent._alpha-=20;
}
many thanks
indebted
SM
Ricod
03-11-2002, 07:57 AM
'Hi ! Don't ever assume the other one knows what you're knowing. So ... eh ? :confused: What exactly do you want ? Why do you want those coordinates and how did you try to get it ?
From what you told, all that is clear, is that you have a clip, inside a clip, inside a clip which u set to the specified coordinates, but you don't want to hardcode them, but get them dynamically right ?
And after its done loading it should alpha fade -20 every frame ...
So, once more ... What exactly do u want ?
simail
03-11-2002, 08:44 AM
Hi Ricod
Yes your right in your assessment
Sorry i didn't make it clear enough
i can't figure out how to dynamically change the co-ordinates
i assume it's some way of using trace
i've been busy reading through the tuts but havn't come
up with the answer yet
do i have to attach some sort of trace function or method to
the control event hadler for the control clip?
i hope this is clearer
sm
Ricod
03-11-2002, 09:14 AM
No ... trace is a function inside Flash mainly used to check things. In test mode you can trace things to put the result to the output window. For instance, u have a script that doesn't work. Now u don't know where it goes wrong, so u place different traces stating the position insid the script. Now u can see in the output window which ones are displayed. Whatever isn't displayed inside the window, is never reached, so it goes wrong somewhere before that.
But what I need to know, is what condition do you have for the dynamic movement of the clip ? (Do you want it to be time dependant, mouse dependant or frame dependant ?)
For instance, u want the clip to follow your mouse (mouse dependant.) You'll need to constantly check its position with the _xmouse and the _ymouse.
Or, you want it to move over a certain time. You'll then need to do a stopwatch kinda thing, using getTimer().
Or, it could be all kindsa other stuff ... lemme know what u EXACTLY want ...
simail
03-11-2002, 10:26 AM
ok this is the senario that i want to achieve:
3 mc's moving randomly around the screen not
overlaping by more than about 10 %. they will
also be randomly scaling
each mc will call in rotation 3 more image mc's
which will fade in and fade out. in other words
only three images being shown on the screen at
one time
i was going to use ._alpha as a sort of timer using
an if statement to change the clips
my thoughts were that if each clip knew the exact co-ords
of the other i could fine tune the effect better than using
hitTest on the other hand thinking about it that might not be true!
maybe i should write the whole thing first using hitTest. sorry, i'm
sort of answering my own questions here.
thanks for the info on trace no wonder i was having a hard time
with it
much appreciation for your patience
SM
Ricod
03-11-2002, 10:36 AM
You're welcome ! Also, to get the specified info ...
_root.clip1x = _parent._parent._x;
U see, by adding the pt.x = _parent._parent._x = 280; you're hardcoding the x coordinate.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.