If you have two superimposed movie clips, how would you refer only to the exposed area of the bottom movie clip? Let's say that there's a large circle with a smaller circle on top of it. If you have... smallCircle.onPress = function() { do something... } bigCircle.onPress = function() { do something else... } ...clicking on the small circle would be interpreted as clicking on the big one as well. How would you get the click to apply only to the samll one?
Two movie clips with instance names. Layer over one another same layer or two different layers. small_mc.onRelease = function() { trace ("small_mc - onRelease"); } big_mc.onRelease = function() { trace ("big_mc - onRelease"); } small_mc.onPress = function() { trace ("small_mc - onPress"); } big_mc.onPresee = function() { trace ("big_mc - on press"); }
Flash should interprete the click only for the top level element. Try using the onRelease event rather than the onPress. I very rarely (once in my programming career) have used onPress, and only because that specific situation required it. The onRelease event seems to handle everything much more smoothly.
Sorry, I should have given more details. The small circle would be on the layer on top of the big one. So draw a big circle, convert to movie clip, double click it, draw a small circle, and convert to movie clip.
[q][i]Originally posted by: [b][b]fwitt[/b][/b][/i] Sorry, I should have given more details. The small circle would be on the layer on top of the big one. So draw a big circle, convert to movie clip, double click it, draw a small circle, and convert to movie clip.[/q] Exactly. That will work with the code I posted small_mc.onPress = function() { trace ("small_mc"); } big_mc.onPress = function() { trace ("big_mc"); }
I think, you are having the two movie clips inside a main movie clip. Right ??? Now you have onPress code for the main movie, and its intrepreted the inside movie clips onPress Actions.... Am i right ????
You cant do like that.... The Flash doesnt support any actions inside a button clip... Even you are using a movie clip as a button, the Flash in turn will consider as a buttons , so all the actions, button and movieclips inside that clip will not a be accessable.....
Don't see what you're looking for? Try a search.
|