actionscript 3 - AS3 - iOS force landscape mode only? -
i've built game ios designed landscape mode , works fine except if turn device portrait mode stops there interface filling middle half of screen. how can force app allow 2 landscape modes , not stop @ portrait position.
i've tried publishing settings. aspect ratio set landscape , auto orientation checked on, if uncheck auto orientation app not rotate other landscape mode , hear that's automatic rejection apple.
this app ready go except little flaw. can offer.
rich
i found answer on over adobe forums few days ago.
set aspect ratio auto.
set auto orientation allowed.
then use code on main clip:
var startorientation:string = stage.orientation; if (startorientation == stageorientation.default || startorientation == stageorientation.upside_down) { stage.setorientation(stageorientation.rotated_right); } else { stage.setorientation(startorientation); } stage.addeventlistener(stageorientationevent.orientation_changing, orientationchangelistener); function orientationchangelistener(e:stageorientationevent) { if (e.afterorientation == stageorientation.default || e.afterorientation == stageorientation.upside_down) { e.preventdefault(); } } worked fine me..
Comments
Post a Comment