Copy link to clipboard
Copied
ok, more rant than help, if i dont find the answer here ill probably think of something in the morning but at least i get to vent some. the geniuses of adobe tried to to an event handling closer to traditional programming, only different in every aspect. ok, event handling, wow, lets do something that is not like common declarative languajes (c, c#, java etc), or that looks similar to at least as2, so lets create an event handling thats is not close to anything else, and instead of specifying or 'turn on' the right flow of the event, let the user 'turn off' all the cases that are not the ones he/she wants (that should keep things interesting), so instead of, if i want to pass an event to a container form the control or sprite that gets it, lets create an event that goes from all controls from the inside to all conatiners, and that does not stop unless the user specifically specifies to stop propagating, so let the user create an event handler for a control that should not need an event handler so it does not propagate, and lets make some useless help in the manual aboput some babbling, i mean bubblibng, and lets spit and let the user imagine whatever we could not do right in design time. in other words, lets be creative.
i have a text field, if i want it to receive input i have to set it to 'mouseenabled=true', and if it has mouseenabled=true, it will propagate the click event (when user clicks over textfield to set focus on it) to the stage or whatever container it has.
so the stage or container or whatever receives a click event, but oh lucky, it gets the parameters relative to the object which got the event in the first place, not relative to the stage (so if the user clicks on the text field, and even though the textfield handled the event, it will propagate the click to whatever sprite contains the textfield, and will be handled by those handlers). so the user clicks on the textfield, the textfield gets focus or whatever, and then withoput specifying to propagate the event, it will pass it to the stage. the stage gets the mouse click, but instead of the stage coordinates, it gets the click with coordinates relative to the textfield (so if the textfiled was clicked on x=10, y=10 relative to itself, the stage will get a click event with x=10 and y=10, evenn if relative to the stage the coordinates where something different -they should be the same only if the textfield was in 0, 0, which is not the case- ). ok, the damage is done, so lets learn how to stop the 'bubbling', and lets make guesses since besides of designing it with thier feet, the other geniuses of adobe could not even write it right in the manual. is there at least in the mouseevent object some property that says who was the original caller? (if i dont find an answer here soon i will look into it in the morning, but i wanted to say this anyway)
Copy link to clipboard
Copied
ok, forget it, i just checked and there is nothing like a reference to the roiginal objetc, but i did it with a mix of localNs and stageNs. ARRGGHHHHHH!... my guess for the people of adobe.. oh yea, thos was stupid, lets make things right, so lets lerease an 'as4' and let users throw everything they've learned from as3 like they did with as1/2 and 'lets get creative' again to make things right (angry)
Copy link to clipboard
Copied
OK. I think I understand your frustration; we all do, though not necessarily this issue. It's hard to bang your head against the wall when you think the language isn't a good match with what you're trying to do. However, I must admit, you've lost me. Could you explain a little more about what you're trying to accomplish? Generally, if the object is part of the display list, you can get currentTarget, as opposed to target, to get the object attributes. If that's totally off topic, it simply means I'm not sure what you're trying to accomplish that is so frustrating.
Copy link to clipboard
Copied
hmm.. hi, what you said it probably helps, yes it is related to the taget of an event that propagates so you got it right, and i could probably get the atributes from each object in the list, and i wrote the things above because i was pissed at the time (and as i said, i got over it using a mix of stageX and Y with localX and Y). anyway, it does not seem a right way to handle things that instead of stopping in a control that handles the event, and the control having the possibility to propagate it to its containers, do the other way, to have to stop the event from propagating, even though controls and forms and containers and stuff have been treated long enough in many other ides and languajes, and as3 does it all just the contrary of the usual, with having to explicitly stop from 'bubbling', and passing the parameters in the propagation relative to the first object, instead of the current container (so what is the pourpose of this, check the whole list and do the math to find current parameters?), well in any case it was just it, and it was solved. tnx anyway
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more