slide effect for stageWebView
hi, everyone.
i'm in flash builder mobile project.
just want ask if there anyway make stagewebview "slide in" stage?
this component world, cannot added element(or child), , way set position viewport.
if "slide in" not possible, fade-in nice. need fancier pop that.
please me!!
you won't able fade in (there no alpha stagewebview), slide in possible.
this entirely untested, should give effect of slide in.
private function addedtostage():void{ var t:timer = new timer(1000/stage.framerate,100); //100 repeat count. timer run 100 times before finishing. can change t.addeventlistener(timerevent.timer,this.slidein); t.start(); } private function slidein(e:timerevent = null):void{ swv.viewport = new rectangle(swv.viewport.x + per_frame_movement,y,width,height); }
swv stagewebview. make sure addedtostage() not run until after parent has been added stage, otherwise stage.framerate error out null reference.
just give idea of how use this, swv 100px wide. set initial viewport new rectangle(-100,y,width,height). if wanted stick 100 frames (between 3 , 4 seconds if framerate 24-30fps), set per_frame_movement 1 , slide x=0 in 3-4 seconds, 1 pixel @ time.
obviously can make move faster or slower messing repeat count , per_frame_movement idea. work math per_frame_movement automatically calculated based on original x position , repeat count (maybe per_frame_movement = ( targetx - startingx ) / repeatcount it).
hope helps
More discussions in AIR Development
adobe
Comments
Post a Comment