actionscript 3 - How to enable orientation change for some views in Flex Mobile? -
i have views in mobile app (for both ios , android) orientation fixed portrait
using <aspectratio>portrait</aspectratio><autoorients>false</autoorients>
in settings xml file.
now have added view plays video youtube , should able play videos, both in landscape
& portrait
orientation. came across this question provides solution restrict 1 orientation (globally views), how can re-enable orientation change 1 view?
note: using flash builder 4.6 actionscript 3 , youtube api
any appreciated :)
remove <aspectratio>portrait</aspectratio><autoorients>false</autoorients>
xml, as generalize whole application.
do seperately each , every view. since first view need portrait,do this.(taken adobe docs)
stage.addeventlistener( stageorientationevent.orientation_changing, onorientationchanging ); function onorientationchanging( event:stageorientationevent ):void { // if stage move orientation don't support, lets prevent // changing stage orientation. if(event.afterorientation == stageorientation.rotated_left || event.afterorientation==stageorientation.rotated_right ) { event.preventdefault(); } }
for second view, not define stage orientation listeners, need both portrait , landscape.
Comments
Post a Comment