I'm creating a pure actionscript 3 mobile project for Blackberry Playbook. One problem I have came across is that there seems to be no inbuilt way to handle view navigation. In flex mobile projects, we have the spark.components.ViewNavigator component, but this isn't available on a pure开发者_Python百科 AS3 mobile project.
These two links are both making their own libraries for view navigation...
viewnavigator-for-as3flash-projects
Support-for-screen-navigation-and-application-session-caching-for-qnx-playbook-apps
What is the best way to handle view navigation on a pure AS3 playbook app?
Are there any older alternative view models we can use out the box?
Update
package {
import flash.display.Sprite;
import spark.components.MobileApplication;
import spark.components.ViewNavigator;
import views.HomeView;
[SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
public class PureAS extends MobileApplication{
public function PureAS(){
// super();
// var nav:ViewNavigator = new ViewNavigator();
// nav.pushView(views.HomeView);
// this.firstView = views.HomeView;
}
}
}
Well, my opinion on the matter is that if you're going to create an application for the Playbook, might as well use Flex and its power, flexibility and productivity. Doing pure AS will give you a slight performance boost, but still not enough to counteract how much more developer friendly Flex is.
With that said, if you really want to implement an AS only version, I would just look at how the ViewNavigator does it and adapt it for Sprites.
精彩评论