Skip to main content
Inspiring
January 26, 2012
Question

Keeping Tilt MovieClips on stage (IOS)-- mouseEvents stay on stage; tilt won't

  • January 26, 2012
  • 1 reply
  • 544 views

Okay, so I am new to making games in flash for the IOS and android. I am trying to use the code that keeps MovieClips that reply to MouseEvents to stop my accelerometer event from going offstage. It has not been succesful. If you have any ideas on how to stop a tilt movieclip from going offstage let me know.

This topic has been closed for replies.

1 reply

Inspiring
January 26, 2012

Let me clerify my post. No one wants objects going offstage. I can stop objects from going offstage when I use MouseEvents, but not with AccelerometerEvents. Any ideas on how to fix this? The main difference is the function parameter. My Accelerometer function has the parameter of event:AccelerometerEvent, while my mouseEvent functions either say event:MouseEvent or just evt:Event. Do you see the difference? The IOS sure does. Apparantely, the accelerometer is not part of the stage family, which sorta makes sense, but if it isn't part of the stage family how can I control the accelerometer movieclip not to go offstage?

Colin Holgate
Inspiring
January 26, 2012

In either case, mouse or accelerometer, you take the values and then set the x and y of the movieclip. You just need to check the value you are going to set, and if it's going to make it be off stage, you don't move the movieclip.