Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AS3: Does `FullScreenEvent` temporarily add things to the display list?

Short Answer: Yes, FullScreenEvent temporarily adds 1 child to the stage.

Long Rant: Well how about that.. I'm not crazy.. I don't know if this is documented but - it's true. That little message that pops up saying 'you can press esc to exit full-screen' adds a single child to the stage temporarily and keeps it on the top level until it fades out. The sudden intrusion of indexes really messed me up.. so there's my answer, I guess. Now i just need to figure out how to get around this slight annoyance.

Searching for phantom child: I tried to find the child, as suggested, in my project using stage.getChildAt(11)+" "+stage.getChildAt(10)+..Etc Etc.. and stage.getChildAt(11).name+" "+stage.getChildAt(10).name+..Etc Etc..(a quick sloppy way to trace it to the text box on the stage..) but i couldn't tie it to a specific name.. the name just came up as 'instance(whatever number in line to be created it was)'. the type was interesting though because it was null.. I don't know if that's normal or anything, but if it was one of the things I had made, it would be [Object Sprite] or something similar.. very odd indeed. furthermore, when trying to get information from the adobe livedocs (like squeezing blood from a stone..) all i could find on the popup message was this:

A Flash runtime dialog box appears over the movie when users enter full-screen mode to inform the users they are in full-screen mode and that they can press the Escape key to end full-screen mode.

"Flash runtime dialog box".. does that mean it IS internal yet it still uses that one index spot?

i tried making everything on the stage alpha=0 whenever the popup was showing (stage.numChildren was one more than it should have been) and everything disappeared when it should have except the 'esc to exit' message..

Sooo.. Yeah.. that's all i can think of right now..

Considering I'm still learning flash, I may have gotten my method to look for the child all wrong. If anyone checks it out and makes a simple prototype to mess with it, please let me know back here what you found out ^__^


As a side note to Tyler, I remembered why I didn't think of doing a trace on Event.ENTER_FRAME. It's because I can't view traces when I view my SWF in a browser. And since FullScreenEvent only works in a browser when the HTML parameter allowfullscreen = 'true' is set, I got too lazy to add a dynamic text box to the stage and update that instead i guess.. =P

Anyways,

Thank you for your time and patience.

Original Post: Hi!

I'm making an image gallery in flash. It's pretty much in working order and I'm quite happy with it except for when i try to make it full-screen.

When I make my gallery full-screen using FullScreenEvent, that little default message letting the user know that they can press Esc appears on screen. And as this message is shown, if i create an image off screen and tween it in to view, the next image will be on top of all of my GUI sprites..

However, if i wait for this little message to fade out and disappear, then everything acts as it should and my image's index is set to 1 like i wanted (underneath my GUI sprites and stuff)..

Now, bear in mind i'm not ruling out that my code is faulty because that's more than likely the case, but after pondering for ages and coming up empty handed, I keep getting a little superstitious that flash is playing tricks on me and that the 'little message' is not independent and is actually added to the display list..

Does anybody know if I'm just imagining things? or is the 'press esc' message a part of my swf on the display list?

Thank you to anyone for their time and if they can enlighten me on this matter.

like image 203
Partack Avatar asked Nov 15 '22 03:11

Partack


1 Answers

I'll admit my initial reaction was a snarky "its your code" (sorry!), but I though about it and really who knows what kind of odd unexpected behavour could be happening, I have seen some strange things in Flash. The simple test would be to trace out .numChildren on an enterframe event, if you see it go up you'll know for sure. (I'll be curious to hear the result)

If it doesn't go up, perhaps you can post some code and we'll be able to take a look for you.

Good luck!

like image 178
Tyler Egeto Avatar answered Dec 09 '22 19:12

Tyler Egeto