ActionScript 3.0 :: Make A Map To Zoom Around The Center Of The Stage?

Jan 21, 2009

up/down/right/left) except for zooming around the center of thestage. Let me explain, the user can drag the map in any directionany number of times but whenever they zoom in/out whichever pointof the map is in the center of the viewable area should always stayin the center.So for example I have several zones in my map, like Zone 1,Zone 2, Zone 3, etc. Let's say the user wanted to examine Zone 1more closely so they move the map in such a way that Zone1 nowappears in the center of the viewable area. I want when they zoomin/out Zone 1 to always remain in the center.

So I have the Map as a movie clip symbol and as a buttonsymbol. In Scene 1 of my Flash document I've inserted the Map movieclip and inside of the movie clip I have the Map button. In Frame 1of the layer where my map is I have the code for moving and zoomingin/out. Here is what it looks like below.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Zoom From Center Of Stage?

Jun 2, 2007

I have a big movieClip which the user can zoom by click on a 'zoom-in' button. Once zoomed the user can click on that movieclip and pan it. Now the center of that movieClip is displaced and no longer where it was before. However, if the user click on 'zoom-in' now again, the movieClip should zoom from the center of the stage and not from the movieClip's center.

To put it simply, I want a formula which will zoom a movieClip from the center of the stage and not from its registration point, no matter where the registration point is.

View 3 Replies

ActionScript 3.0 :: Zoom To Center Of Stage?

Aug 31, 2010

Is there a way on a drag zoom image viewer to have the draggable mc scale from the center of the stage rather than from its registration point?

View 1 Replies

ActionScript 2.0 :: Move Icon1 To Center Of Stage After Zoom Map?

Jun 20, 2007

I have a point in MC (map/map1/icon1), I want to move icon1 to center of stage after zoom map.

View 4 Replies

Actionscript 3 :: Set Zoom On Mouse Click Target To Center Of Stage?

Aug 24, 2011

I'm having toruble with an image that I zoom into in flash. I got everything to work, only I want the clicked X and Y coordinats to center to the stage. ( so that the area clicked on always zooms in and position the area clicked to the middle of the stage) the image is a movieclip and it zooms with a tween, but i tried everything but the image wont center the stage..

does anyone have a clue for wich actionscript 3 code I can use to do this?

my code is:

const TWEEN_IN:String = "tweenIn";
const TWEEN_OUT:String = "tweenOut";
var tweenDirection:String;

[Code]....

View 1 Replies

ActionScript 2.0 :: Zoom/Pan UI Won't Center On Zoom In?

Jul 8, 2009

I'm developing a full screen zoom/pan UI. Everything is working great, except I can't get it to center on the correct point when zooming in.

You can view what I have here: [URL]

The numbers in the top-left corner are the navigation, and the white boxes represent the individual sections.

I have a large container movieclip that fills the entire page. Inside of that movieclip (site) I have all of my individual section movieclips (section1-section6). I'm also using a dynamic registration point class to dynamically set the registration point of the "site" movieclip to the current selected section, so that the zoom in/out is centered on that section.

When a user clicks on a navigation item, I first reduce the _xscale and _yscale of "site" to 80, when that is complete I move _x and _y to the position of the selected section's movieclip. When that is complete, I set the _xscale and _yscale back to 100. Right now, it is not zooming in centered, so I have a final step where I correct the _x and _y position after zooming back in.

If I don't zoom in/out I can successfully pan the movieclip and center on the correct section. I believe the problem is that I am moving the _x and _y to the position of the "site" movieclip as if it is at 100%, but since it is at 80% it is not moving to the correct position. I tried to fix this by giving the _x and _y coordinates as:

endX = endX / 100 * 80;

Which made it a little better, but still not centered. I have a feeling that there may be a fundamental flaw in my approach to this.

For some reason the forum won't let me attach my .zip, so I posted it online, as well: [URL]

My code below, in case you don't want to download the file:

Code:
tile._alpha = 0;
currentSection = section1;
//** Set Stage **//

[Code]....

View 1 Replies

ActionScript 2.0 :: Make A Center A Mc Automatically On The Stage?

Oct 21, 2004

How do a make a center a mc automatically on the stage with aS. The script should detect what the stage size is and move the mc to the middle.

Im making smartclip-preloader and want to be as productive as possible later on.

View 4 Replies

ActionScript 2.0 :: Make Clip Go To The Center Of The Stage And Stop?

Jan 12, 2006

ahoy there me hearties

Ive got a bit of a dilemma...

new Tween(clip,"_x",Bounce.easeInOut,clip._x,Stage.wid th,6,false);
new Tween(clip,"_x",Bounce.easeInOut,clip._x,Stage.hei ght,7,false);

what would be the correct way to write this to make clip go to the center of the stage and stop? At the moment it takes off to the left, never to be seen again..

View 2 Replies

ActionScript 2.0 :: Make A Movieclip Push Out From The Center Of The Stage?

Oct 16, 2008

I'm trying to make a movieclip push out from the center of the stage, but I'm having a problem with the math.I made an function, but it pushes out in a diamond shape.

Code:
function newCords(newX:Number, newY:Number, distance){
var centerX = Stage.width/2;
var centerY = Stage.height/2;[code].....

View 7 Replies

ActionScript 3.0 :: Make Image Rotator Align To The Center Of Stage

May 8, 2011

I bought a file, its an image rotator and it has a following code. I was wondering how can I make this image rotator align to the center of my stage.

[Code]....

View 1 Replies

ActionScript 3.0 :: Make Drag And Drop And Catch Page Center To Stage?

Feb 13, 2011

want to make drag and drop and catch page center to stage

View 2 Replies

ActionScript 2.0 :: Zoom Into Map And Center?

Jul 13, 2005

I have a slider which increases and decreases the scale of the map area, however, I cannot work out how to make the area being zoomed into stay in the centre of the map.I have attached an example file to highlight the problem. If the red dots are lined up and the slider moved I want the red dot on the map area to stay in the same place and not move as the map grows.

View 7 Replies

ActionScript 3.0 :: Zoom Pan To Center?

Jan 28, 2011

I am having issues with my code using a slider and zoom pan:Here is the part of the code I am having issues with....

function dragslider(e:Event):void
{
newValue = (navigator.zoomSlider.mySliderBar.x-xPoint) / fullWidth;

[code]....

I am trying to get my map to zoom from center of stage. I am trying to convert this from an as2 project.

View 3 Replies

Professional :: Get Zoom-out Tool To Center?

Mar 20, 2012

When I zoom out, instead of centering the document on my zoom, it pushes the doc to the upper left corner. It is pretty maddening, as I am zooming in and out a lot.
 
Is there a way to manually center the artboard?

View 3 Replies

ActionScript 3.0 :: Pinch To Zoom From Center Into Map?

Oct 17, 2011

I'm currently using the pinch gesture to zoom into a map I'm making. My problem is that the map zoom's from the top left corner when I'd prefer it to zoom from the centre.

View 3 Replies

Professional :: Zoom To Movie Clip And Center On Child?

Jul 20, 2010

I have a movie clip of all counties in the state of Montana (allcnt_mc). Within allcnt_mc there are individual movie clips specific to each county with name equal to the county's name. When clicking on a county, I'd like to zoom to that county and center the stage on it. I've added event listeners to all counties through querying an xml table that has demographic info I am calling into dynamic text boxes. Here is the code I have thus far to load the xml and add the listeners to the county movie clips.
 
//load xml
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

[Code]....

View 5 Replies

ActionScript 3.0 :: Flex Build Center Zoom Images?

Mar 27, 2011

i need created zoom for image in flex,

View 3 Replies

ActionScript 3.0 :: Zoom Mc_1 To Center Of Reference Point Mc_2?

Nov 10, 2009

I am building a map app that allows you to drag a map around the screen and it is masked to only allow a portion of it to be seen as you zoom in. For zoom, I can only think of scaling the mc_1 (which is the map). Since my stage is larger than my map viewable area, i have placed a mc_2 as the background to the map. mc_2 is the "stage" for mc_1. So mc_1 is above mc_2.

I want to enlarge mc_1 by easing out...but don't know how to scale it where it looks like a real zoom effect. I figured I would just have the user click a + button and it would scale it to a predetermined size. how to ease it in/out?

Lets say my map was of the united states and I drag the map around my window and Texas is in the center point of the mc_2. How do I zoom in on Texas, instead of it just scaling mc_1?

View 4 Replies

ActionScript 2.0 :: Make Banner's "zoom In And Zoom Out" On A Movie?

Aug 6, 2003

i have visited a very good flash site..I gotta give credit for their dedication and their work as well. [URL] I wonder, how they put all those animation in a banner with that small size of file ? I mean banner's size is not big at all. My other question is that, how do you make it "zoom in and zoom out" on a movie..Like on those banners. Do they binding all the layers to make it a movie then resize it on the movie or what?

View 3 Replies

AS3 :: Draw A Line From The Center Of The Stage Out And Increment Around The Stage?

Jan 31, 2010

I am trying to have flash draw a line from the center of the stage out and increment around the stage. Not sure what math I would use to do this though. So far I have the line going out to a certain point but not sure how to change that point so that it circles around whatever the dimensions of my stage would be.

So far I have this:

var linetox=0;
var linetoy=0;
var _stage=this;[code]...

which obviously moves the destination ending of the line lower and lower, just trying to get it to draw around the screen (like a clock)

View 1 Replies

ActionScript 3.0 :: How To Zoom The Stage Through

Apr 6, 2010

I am making tile based game. I need to zoom my stage.

View 2 Replies

Professional :: Zoom Into The Stage?

Jul 10, 2011

I want to create a presentation in flash (as SWF file) and I want that in the final SWF file there will be an effect that zooming into one of the stage's object, say for instance this is a picture I want to zoom in and out to/from it, so how can I do it and is this involved with actionscript integration or not?

View 2 Replies

ActionScript 2.0 :: Zoom In And Out Whole Stage By It?

Jan 4, 2012

I've done a movie which has a lot of motion tweens. I need to zoom in to a particular point. I don't want to do it by tweening. Must to do by actionScript code.

View 0 Replies

ActionScript 3.0 :: How To Zoom Stage

Apr 6, 2010

I am making tile based game. I need to zoom my stage.

View 2 Replies

ActionScript 3.0 :: Zoom Out While Enlarging Stage

Feb 11, 2010

Here's what I am trying to do: zoom out (shrinking everything), while revealing more space to work with. What I did: Modify _xscale and _yscale. It worked, however the results are not what I expected. Problem: While this cause everything to shrink by the scale amount, the entire Stage shrunk as well. So my 700x425 flash is mostly empty, while the stage itself is being rendered in a small rectangle in the corner. I cannot move any objects outside of this small box. Most of the flash space is wasted. Is there any way to shrink the scale AND enlarge the Stage.width/height at the same time to zoom out and create more canvas space?

View 2 Replies

ActionScript 3.0 :: Zoom In Part Of The Stage?

Mar 24, 2010

I would like to know how to achieve an effect like in Flash Element TD 2 http:[url]....when you select a tower or a creep you can see a real time zoom of what you select on the right side panel.

View 5 Replies

CS4: Can't Center The Stage

Apr 20, 2009

I'm having trouble centering the stage on screen, its locked to the top left of my window and nothing will make it move. I remember accidentally pressing something on the keyboard just before this happened, but don't know how to get my stage center again. The hand tool does nothing.

Oh and its only happened in this fla, other fla's are fine.

View 3 Replies

ActionScript 3.0 :: Center A MC On Stage?

Jul 11, 2010

I need to center a MovieClip, and i know how to do this, but the problem is this MC has content in it of different sizes on each frame. So when it goes to say, frame 2, the MC is no longer in the center. This is what i use:

ActionScript Code:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);

[code]...

How can that be changed to center this MC when the size of it changes? I would guess the code would need to know when the MC's size has been changed and re-align...

View 0 Replies

ActionScript 3.0 :: Center MC On Stage?

Feb 9, 2009

I have a MC on stage that I dynamically add and remove elements to and from. Since its dimensions vary subject to those changes I's like to "pin-point" it to the center of my (800x600) stage. I thought it would be agood idea to get the dimensions of the MC (it's called container) and set its x and y accordingly, but somehow it won't work as I got the feeling the registration is somewhere else (and I don't get the logic behind where it is).

The code I am using at the moment is the following

Code:
var dimensions:Rectangle = container.getBounds(stage);
container.x = 400 - dimensions.width/2;
container.y = 300 - dimensions.height/2;

View 3 Replies

IDE :: Can't Center The Stage On Screen

Apr 20, 2009

I'm having trouble centering the stage on screen, its locked to the top left of my window and nothing will make it move. I remember accidentally pressing something on the keyboard just before this happened, but don't know how to get my stage center again. The hand tool does nothing. Oh and its only happened in this fla, other fla's are fine. See attached image for screenshot

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved