Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE FLASH:HomeFlash ForumFlash TutorialsFlash Video TutorialsWeb Streaming ForumAdobe FlashPodcast

Advanced camera panning

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Tyler FreemanAdvanced camera panning
by on Apr 22, 2012 at 2:25:06 am

I have the following code which lets me pan an image with mouse movement in a simultaneous x and y pan. (I will post my code following this post). I have made sure that my background image is a bit larger than my stage to account for movement. My results show the background moving upwards the top stopping nicely at the edge of the stage, however the bottom comes up just a little bit to far revealing bare stage. Why does the left and right work just fine but the up and down are screwed up. The "X" script is identical to the "Y" script. (with the exception of the x and y's).


Return to posts index
Reply   Like  

Tyler FreemanRe: Advanced camera panning
by on Apr 22, 2012 at 2:25:40 am

My code:
import fl.transitions.Tween;
import fl.motion.easing.*;
import fl.transitions.TweenEvent;
var picTween:Tween
stage.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoved)
function mouseMoved(e){
var yPercent = mouseY / stage.stageWidth;
var newYPos = (stage.stageWidth - pic.width) * yPercent;
picTween = new Tween(pic, "y", Circular.easeOut, pic.y, newYPos, 1, true);
import fl.transitions.Tween;
import fl.motion.easing.*;
import fl.transitions.TweenEvent;
var picTween:Tween
stage.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoved)
function mouseMoved(e){
var xPercent = mouseX / stage.stageWidth;
var newXPos = (stage.stageWidth - pic.width) * xPercent;
picTween = new Tween(pic, "x", Circular.easeOut, pic.x, newXPos, 1, true);
}
}


Return to posts index
Reply   Like  

demetri tashieRe: Advanced camera panning
by on Apr 26, 2012 at 2:34:47 pm

i would check the registration point of the image within the movieclip 'pic', as well as then the placement of the movieclip 'pic' on the actual stage.


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]