target buttons
- Started
- Last post
- 24 Responses
- rasko4
ok I need to call (from the main timeline) on buttons which are inside a swf loaded into a blank mc. Basically, on the main timeline I have a movie clip of a menu (basenav), inside that is a movieclip of a sub menu (popnav), inside popnav is a blank movieclip (infini) into which an external swf is loaded. Inside this swf there is yet another mc (inside1) and another inside that (inside2) in which are my buttons.
so, on the maintimeline I am calling the buttons like this:
_root.basenav.popnav.infini.insi... = function() {
but it doesn't work :(
how do I target buttons from the main timeline that are inside a loaded swf? Is it possible?thanks!
- save0
wow, you still working?
- rasko40
ai lad, the bastards reckon I have to earn my money, I heartily disagree!
I'm going to cry.
heh
- Nematoth0
you have to target the level into which the swf is loaded.. I think thats the problem..
something like _level2.inside1.inside2.mybutton... = function() { xxxxx}
summat like that... I think..
- rasko40
bugger that doesn't work either :(
- Nematoth0
try running the debug tool when you test the main movie.. CTRL, SHIFT + ENTER then just get the target from there.. thats how I normally find them when they are hard to figure out..
you should see all the different components of your movie and their relevant 'targets' ...
Hope that help..
- rasko40
it wont show because the buttons are in a seperate swf that is loaded into the main timeline.
I'm not trying something that cant be done am I?
- Nematoth0
it should show.. I have movies that I use as a base.. (level0) then call othe swf to be lloaded externally.. and they show up in the debugger as _level1.whatever etc etc..
Are you debugging the main timeline.. ?
- Nematoth0
this is definately possible if I understand what u are trying to do correctly...
You just have to make sure that you debug the base movie.. then all the other movies that are loaded from that will appear in the debug menu also...
- dstlb0
If you're loading into a blank MC on the main timeline it shouldn't be anything to do with levels should it?
You only need to target a level if you're loading MCs into a _level instead of loading them into an MC.
- vespa0
make sure you aren't trying to call them before they are loaded...?
Is the swf loading? Try running a traceable action out of the swf's btns to make sure they are all getting loaded ok.
- rasko40
hmm i cant open the tree within the debugger out enough to get all the way to my buttons.. I get as far as _level0.basenav.popnav then I cant see 'into' the other swf.
dstlb, yeah I basically have a swf which is a sliding menu (the buttons are nested to mc's deep (inside1.inside2.mybutton), this swf is loaded into a mc on the main timeline (_root.basenav.popnav.infini)
I am therefore trying to target the buttons from frame1 on the main timeline using _root.basenav.popnav.infini.insi... = function() {
and others I have tried.
The function works if I just put a button on the main timeline and target that, but I need to target the buttons inside this swf
???
- dstlb0
1. Check the swf is loading.
2. Check you're not running the script before it's loaded - try putting a trace on the end of the script that targets the button and another trace on the first frame of the loaded swf. When you test the movie the output box will tell you which script ran first.
3. Try and target it from a button on the main timeline just to see if that works, might reveal something.Can't think of much else right now, sorry...
- Neuarmy0
im having a similar prob rasko...it's so frickin frustrating.
i hope unfit saves you...
then maybe that'll help my ass too.g'luck
- rasko40
well the script works fine when using a buttom dumped on the main timeline. The buttons in the loaded swf are able to control things on the main timeline.. its just I cant seem to target the buttons although I cant se why as it all seems correct?!
I'm not sure how to do all that 'tracing' business, Flash aint my hotspot really.
- rasko40
this is infuriating.. somebody must know how to make buttons in a loaded swf work from the main timeline?!?!!?
nightmare
- Neuarmy0
i feel yer pain rasko...
- unfittoprint0
the best way to test them is to use trace.
something like.
myButton.onPress = function(){
trace(this._parent)
}you can change
this._parent
to
this._parent._parent
or
this._parent._parent._parent
until the _root [level0] is trace than you'll just have to use that prefix to trigger any action on the main timeline.
- dstlb0
I'm pretty sure it's a preload issue, the script is running before there's anything for it to target...
Move the script that targets the buttons to frame 2 of the main timeline.
Put a preloader on frame 1 of the main timeline that targets the empty MC, when it's loaded send the main timeline to frame 2.
I can send you a FLA if it would help.
- rasko40
yeah if you could send something over it ewould be a huge help, I'm going crazy here!!
thanks :)
- Neuarmy0
hey dstlb, could you send one my way too...im running into a similar problem, it might help me out.
thank you!
mailto:ryan@neuarmy.com