[quoted text, click to view] > you can only control an instance when it exists on stage, so you can't
> control
> 'record' when 'animation' is on another frame than frame 10.
> To set some properties of 'record' from root, you could set variables in
> 'animation', check on frame 10 for their value and change 'record'
> accordingly.
> Direct access to 'record' from root is only possible in frame 10 of
> 'animation'.
Blemmo,
First off, thanks for answering. I see your posts around quite a bit and
appreciate people who have the knowledge and don't mind spreading it around.
I am relativley new to actionscript. I started using Flash 6 about five or
six years ago but I only did timeline tweens and did not touch the program
for a few years. Although I do have a background in OOP in several
languages so I have caught on quickly to as starting with mx2004.
One of the things I *hated* when I first started (esp. reading other's
files) was finding the code in all of the embedded MCs in the movie. So,
now, I have started doing all of my in-movie code on a single _root frame.
Then, after development I move it into an external as file. So I can't do
this, right?
The movieclip 'record' on frame 10 of 'animation' is a picture of a record.
When an mc is pressed the movieclip 'animation' plays from frame 1 to 10,
stopping on 10 where the movieclip 'record' resides. Now that the mc
'animation' is on frame 10 I want to activate an onPress event handler to
the 'record' mc. So, since 'animation' is on frame 10, should I be able to
control 'record'?
for simplicity's sake:
button1_mc.onRelease = function() {
this.onEnterFrame = function() {
animation.nextFrame();
if(animation._currentframe == 10) {
delete this.onEnterFrame;
animation.record.onPress = handleRecordPress;
}
}
}
function handleRecordPress() {
blah blah blah;
}
Thanks.
Oh well.