| Author |
Accessing frames in movie clip
|
|
| spamGactus 2007-07-18, 3:16 am |
| This is a really dumb, basic question, but my inexperience combined with lack
of sleep is making this difficult.
I have a movie clip called "desc_sushi_saumon" who's animation starts at frame
2. On the same layer as this clip is a clip called arr2_main. I want to play
"desc_sushi_saumon" frame 2 when I click on arr2_main.
I tried this:
on (release) {
desc_sushi_saumon.gotoAndPlay(2);
}
and that doesn't work. I've tried using the full pathname:
_root.pages.page1_m.desc_sushi_saumon.gotoAndPlay(2);
but that doesn't work either.
What am I overlooking?
joe
| |
| aniebel 2007-07-18, 6:16 pm |
| When you say it's called "desc_sushi_saumon", do you mean that it's the name of
the symbol or the instance name? To be honest, that FLA you got is not
assembled in the best way but it's not the end of the world. Make sure the
INSTANCE name is desc_sushi_saumon... not just the symbol name.
Let me know what your findings are. I still have the FLA you originally posted.
| |
| spamGactus 2007-07-18, 6:16 pm |
| I've tried it both ways - no luck. Which syntax should I use? Do I need to use
tellTarget or something?
[color=darkred]
Thanks for saying that - I've been thinking the guy that wrote this was some
kind of genius, and that I didn't know whst I was doing (I still don't know
what I'm doing, but I don't feel quite as stupid)..
| |
| aniebel 2007-07-18, 6:16 pm |
| Can you post the FLA again? I assume you've added the new movieclip?
| |
| spamGactus 2007-07-18, 6:16 pm |
| Got 'er done!
Here's what worked for me:
on (release) {
with (_parent.desc_sushi_saumon) {
gotoAndPlay(2);
}
}
BTW - I've been working with this fla and thinking I should be adapting some
of his techniques in my own movies - now I'm not so sure. Can you tell me some
of the things in this movie that I should avoid doing?
Thanks,
joe
| |
| aniebel 2007-07-18, 6:16 pm |
| First off, avoid placing "on()" event handlers on objects. Try to keep as much
code on your main timeline as possible.. preferably in a locked layer titled
"AS" or "actionscript". It's much easier than searching around the FLA (like we
both did) to find code. Your handlers would be more like:
my_btn.onRelease = function(){.
//tell it what you want it to do here... "this" meaning the button
this._parent.desc_sushi_saumon.gotoAndPlay(2);
};
Second, I'd load those clips from external SWFs rather than movieclips from
the library. The more you break things down into individual tasks, the better.
Let the main movieclip (SWF) be the control center with most (if not all) of
the code.
You mentioned "tellTarget"... that has been deprecated since Flash Player 5.
That doesn't seem to make sense how you got that button to work. Using "with"
is for multiple commands. You should have been able to acheive the same results
with your original code. Now I'm curious.
| |
| spamGactus 2007-07-22, 6:15 pm |
| I know this is a rather late reply - I've been really busy with this project,
and haven't had time to come back here...
My problem was that I didn't attach an instance name to it. Named the movie
clip, and it works like a champ
Thanks!
joe
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |