Short version:
Is it easy/feasible/possible to program modal window in Flash (AS3)? Is there a built-in functionality for it?
Long version:
I’m working on a Flash widget (in AS3), and I would like to be able to show a movie clip in a modal fashion. Essentially, I need a simple modal window inside the wieget. So far I learned that that I need to implement the "modalness" by myself (in AS3). There used to be something in previous versions of Flash and there is something in Flex, but I have not experience with Flax and I’m not sure what it involves.
I proceeded to write it myself without any deep planning upfront and soon and hit some problems. It seems that the root of the problems is that I cannot keep a focus on a movie clip (or an InteractiveObject
to be precise). I handle both KEY_FOCUS_CHANGE
and MOUSE_FOCUS_CHANGE
events while trying to prevent losing focus FocusEvent.preventDefault()
. But I still manage to lose the focus by mouse clicking. What’s even weirder is that when I force the focus using the Stage.focus
property, I get an ugly looking thick yellow line around my movie clip. In presumably indicates that the movie clips is focused, but normally it’s not anywhere. Does it mean that the object is not focusable, but I somehow force focus it anyway?
I realize that the questions above are not very clear and I don’t expect to actually answer them. But what I’m trying to indicate is that it seems that I’m doing something wrong. So the main question is that: Is there an easy way to get a modal behaviour in Flash? I think programming it from scratch and piping and handling variously little events is something I should not be doing.
The fact that is irritating me the most is that I need this modal widow to handle and display some edge case error messages. And so putting so much effort into it does not seem right. Maybe, there is a completely different way.
I’m aware of the fact that the this question is not perhaps supported by enough research, but I started working on something which I thought would take me half an hour and it has already been several hours. I may do more systematic research and post more concrete questions later.