-
hello,
ive got the following problem.
there is a kind of menubar in the main scene. each button that is clicked tells a different movieclip (also in the main scene) to play. the problem is that every menubutton should check if another window is already open and if its so first close this (play a certain frame in the movieclip).
if tried this by setting variables like this.
in the menubar :
on (release) {
tellTarget ("../facts") {
out = "1";
}
}
and in the first keyframe of the other movieclip :
if (disco == 1) {
tellTarget ("../disco") {
gotoAndPlay (21); (++ move backward ++)
}
} else {
play ();
}
play ();
what is wrong....
perhaps someone could help me
thank you
racka
-
Well, you variable names dont seem to match up but that may be just me. In the main timeline you reference out=1, but in your MC timeline, you dont use out at all, so did you forget to inlcude that or does that go elsewhere?
But I do see one thing that might cause a problem. In your if() statement you say disco==1. If your wanting to know the current frame the MC disco is on, you have to say disco._currentframe, otherwise flash treats disco as a variable and just evaluates it to whatever value it has at the moment. You might also consider learning dot syntax, cause then what you wrote there become
_root.disco.play(21)
Hope that helps some...
-
thank you, still one little question
now everthing is working fine i`ve used the following syntax
if (_root.disco._currentframe=20) {
_root.disco.gotoandplay(25);
}
but i need the flash4-compatible syntax (tell target didnt work when i tried it)
thanks a lot
-
Ahh, well, Im not very familiar with flash 4 syntax. I like version 5 better because it actually has some structure to it like C++ or Perl. One thing though.. in your if() be sure to use == or it wont work right. Not sure if that was a mistype or not...
-
Welcome to flavour country
I believe this is the Flash 4 syntax
If(GetProperty("../disco",_currentframe)=20
BeginTellTarget("../disco")
gotoAndPlay(25)
EndTellTarget
EndIf
-
not working
this is not working, perhaps my fault?
-
I dont remember correctly, but did flash 4 equate "is equal to" as eq or ==? if you copy what thewiz line for line wont that just set currentframe=20 every time?
-
Welcome to flavour country
Sorry, I though your button was in an mc.
I tested this and it works.
Code:
on (release){
if (getProperty ("/disco",_currentframe)==20){
tellTarget ("/disco") {
play ();
}
}
}
This is Flash 5 code that is publishable for Flash 4.
-
everything is fine
thank you very much for your quick help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|