Skip to main content
July 18, 2011
Question

Scenes and Apps?

  • July 18, 2011
  • 2 replies
  • 319 views

Hi Guys,

I have been working on my second app and I am using scenes to separate the various elements, 4 in total, home and 3 simple game modes.

First off does anyone use scenes? I remember reading most coders dont like scenes because they tend to cause problems, is this still true, is it true for apps? Should I just keep all of my stuff on one time line?

Next off I am having a strange issue when going from scene to scene. The first mode runs smooth but as I go through other game modes and eventually get back to the first one it starts slowing down and the more I move around the app the more the performance seems to suffer. It feels like there are events still triggering in the background and they keep stacking adding up and slowing down the process. I use WeakRefrences and remove all the events I am aware of but it still seems to be some issue.

And here is one I cant even wrap my head around, in one mode you tap a button and it runs an addChild function I have a multi touch event listener assigned to it and if you just tap the button you can only get about 5 objects on the stage before slow down but if you put one finger on the stage but off the button and tap with the other finger you get crazy good performance closer to 15 objects before the app begins to bog down which would be fine in my case.

Any thoughts would be helpful.

BTW this is with Flash Pro 5.5 and air 2.7 on iPhone 4 with latest iOS, not the beta stuff, latest public release.

This topic has been closed for replies.

2 replies

Colin Holgate
Inspiring
July 19, 2011

Scenes work well, and are extremely useful if the project is largely animation, that is scene-like. I did an app that had about 6700 frames, and using scenes was a lot easier to manage than have a single scene that was that long.

If you're just using scenes as a way to organize a few screen arrangements, then you may as well use one scene and a few frame labels, one for each screen layout. Doing it that way could easily let you share elements across several of the layouts. I work that way a lot.

I think that with touch events you can set the frequency that you're looking at them. There are hundreds a second, and if you're trying to do something on every one of those, that could get demanding.

The other slowdowns you mentioned probably would still happen if you had a single frame FLA. Look around for the usual solutions to that, such as freeing up bitmap memory where possible.

July 19, 2011

Thanks you guys. Looks like I dont stand to gain much from converting my 4 single frame scenes to on scene and one timeline, I might try it anyway.

I did however solve my weird two finger one finger button issue. Turns out I had the object that is tapped set to a button and simply by changing it to a movie clip solved the weird issue so that was a nice performance boost.

relaxatraja
Inspiring
July 19, 2011

coding and maintenance is not comfortable when using scenes, not for practice. and for app it should be a single frame concept, much frames without programming will not help you much. if you'r going to scenes, then you also have more frames with more contents (not comfortable for developers). For performance point of view also you should keep everything in 2 to 10 frames concepts. multiple scenes and multiple frames will consider for performance.