flash help
- Started
- Last post
- 19 Responses
- de4k
I have a button in the main timeline.
onRelease I want to play a frame in test.swf, that's in test.mc in the main timeline.
any help?
- ItTango0
assuming you've loaded the swf via AS, do this
on(release){test.gotoAndPlay("fr...the frame name of the loaded test.swf that you want to play.
- st33d0
Eh? So what is test.swf loaded into?
In the button:
on(release){
_parent.myClip.gotoAndPlay(0);
}Replace "myClip" with the name of your clip instance.
- Mishga0
On (Release){
_root.test.mc.gotoAndPlay(10);
}:/..something like that..???!!
- ItTango0
i guess the question here is: what is the instance name of your container clip?
- st33d0
Stear clear of using _root. It fucks up preloaders. Use _parent instead and make your code portable.
Seriously - I used lockroot = true to try and get a MenuBar component to work and it failed under all circumstances. I got fed up and wrote my own components.
Don't be like Macromedia developers. Write that shit to last.
- de4k0
yeah still no joy...
container clip in main timeline:
blankmc_masterswf inside blankmc_master:
images.swftarget frame:
12
- ItTango0
"Stear clear of using _root. It fucks up preloaders. Use _parent instead and make your code portable."
st33dI agree. And if your button is not nested inside of some mc, you can skip the _parent thing as well.
Just target the instance name of the container clip and indicate the frame name or number in the .swf you're loading and be done with it!
- ItTango0
blankmc_master - is that the instance name?
- ItTango0
how are U loading "images.swf"?
- st33d0
But you still haven't said what the images.swf instance is called. If it is on the stage, go to properties and click on instance name and give it one.
on(release){
_parent.blankmc_master.myUnknown... ImNotTellingAnyoneWhatItIs.gotoA...
}
- de4k0
how am i loadinghow are U loading "images.swf"?
ItTango
(Dec 12 06, 09:15)blankmc_master.onEnterFrame = function() {
loadMovie("images_800.swf", blankmc_master);
- ItTango0
Exactly...
- de4k0
images_800.swf is the actual name
I just said images.swf for speed.
why would it have another fucking name?
- st33d0
Let me get this straight:
onEnterFrame is called every frame of running (tis the way it works). It's not called just once but over and over again.
Now, if you keep telling it to reload those images....
- de4k0
forget onEnterframe it's worked for two years.
I have no instance name for images_800.swf
that is the only name
- st33d0
I assumed the images.swf was being loaded into an instance.
My bad.
If you put your image loading code on the main timeline it will run once and not again.
And for preloading your images I have a good tutorial for you:
- ItTango0
the name of the incoming .swf doesn't matter after it's loaded. and you don't wanna' keep calling the on clip enter frame thing. how about a little AS in the appropriate frame (loadMovie("images.swf", blankmc_master);
then your button actions should control the loaded clip.
- st33d0
blankmc_master.onEnt erFrame = function() {
loadMovie("images_8 00.swf", blankmc_master);the problem with this is that you are INSIDE blankmc_master during the onEnterFrame function. Thus you cannot see the beast for you are in it's mouth. My guess is to try:
loadMovie("images_800.swf");
- ItTango0
in some frame: (loadMovie("images.swf", blankmc_master);
for some button:
on(release){blankmc_master.gotoA... number or name");}