This content has been marked as final. Show 8 replies
you have mismatched curly brackets so you should see a compiler error.
sorry it was my fault
the curly brackets are a typing error in the message and when I run the file I see no compiler error but also no animation...
copy and paste your code using the attach code option in this forum.
all right, the completelly code is attached
btn.onRelease = function()
Sorry I missed.
You have to give a whole path of the variables.
Thanks to next floor.
that code probably isn't going to do what you want it to do.
if you want each button to play and stop its associated movieclip, you probably want to use different boolean for each button. so, use this.isHighlighted instead of isHighlighted in your onRelease handlers.
but if none of your buttons are calling their onRelease handlers, you have a more basic problem: the instance path/names of your buttons don't match the names in your script.
I think I figured out the problem. For testing I created a new scene. There I created a folder and a layer in this folder. All actionscript code is located in a root layer at the beginning of the scene.
The hierarchy looks like this:
-> -> button_layer
If the button is located in the "test_layer" all works fine. But if I move the button to the button_layer, the script isn't working.
Now my question is, how should the path to the button look like?
I tried some combinations ( _root.BUTTON_FOLDER.button_layer.myButto n and so on) but nothing works.
Thanks again for help,
layers and folders in your layers are irrelevant. no layers are in your published swf.
layers are used by flash to assign depths to stage objects and can be used to determine code execution order.
so, the path to your button should be:
and it doesn't matter which layer contains your button. only that it has the name property that matches the name used in your actionscript.