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


Similar Posts:


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 3.0 :: Finding A Point Relative To A Center Point?

Nov 9, 2010

I'm trying to figure out how to find a point relative to the center of an object, modified by its rotation. For example, in the attached swf, I've been messing around trying to draw trails to a bitmap, coming out of the thrusters. I didn't have a problem at first, but as the ship rotated, the lines that were being drawn wouldn't remain relative.

http:[url]....

I'm sure this is because I have no idea what I'm doing, and I've just been sort of idioting my way through it. That aside, is there an easy way to find the point I'm looking for? For instance, say I want a point at Y -14 of my ship, but I want that to remain relative to the ship as it rotates.

View 14 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

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

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

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 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

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 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.0 :: Flex Build Center Zoom Images?

Mar 27, 2011

i need created zoom for image in flex,

View 3 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 :: Put Anchor Point To Center Through It?

Oct 20, 2009

I have a dynamic image loading into a movie clip and i dynamically created a transform box around it. However the anchor point of that transform box is coming on the left top instead of in the center, which is not letting the image transform properly. how to dynamically put the anchor point to center through AS2?

View 1 Replies

ActionScript 3.0 :: Set Rotation Center Point?

Jul 9, 2010

I am new in action script 3... i am not able to rotate movie clip from center point(movile clip is a containear holding many clips).

View 9 Replies

ActionScript 3.0 :: Find Center Point Of Pie?

Aug 26, 2010

i am trying to find center point of my pie.

var myTween:Tween = new Tween(piechart,"............", Strong.easeOut,1200, 510, 1, true);

i want to animate from the center and it has a xml driven data file.

View 2 Replies

ActionScript 3.0 :: Center Point Of Resizing?

Feb 20, 2009

I have a sprite and a tween created using actionscript.

the sprite resizes correctly but the center of resizing is the upper left corner.

How can I set the resizing point to the center using actionscript ?

View 3 Replies

IDE :: Images Rotating Around Center Point?

Dec 10, 2009

how to do an effect like the one seen on this page?: http:[url]....

View 1 Replies

ActionScript 3.0 :: ScrollWheel Zoom With Point Of Focus At Mouse Cursor Tip?

Jun 18, 2010

Looking for code to enable zooming in/out on a graphic or movie clip using mouse scrollwheel with origin of scale change being at the mouse cursor position. I have one where it is at top left. I also require it to stay proportional, when applied to a rectangular graphic my code makes it go letterbox on zoom out!

View 3 Replies

Flex :: Scale To Point (Zoom Into Image Where Mouse Clicked)

Jun 14, 2010

There is an Image control that when I click on it I need to zoom in (using the center/transform point where the mouse is clicked). I have the zoom transition working great, but when I set transformX & tranformY (with autoCenterTransform false) it doesn't zoom into that point.

Here is my code that only zooms in (not to a specific point)
<fx:Script>
<![CDATA[
protected function imgLogo_clickHandler(event:MouseEvent):void {
transformer.play();
} ]]>
[Code] .....

View 1 Replies

Professional :: Moving Center Point For Triangles?

Apr 7, 2011

I'm trying to get a triangle to spin in place,

View 7 Replies

Actionscript 3 :: Set Registration Point Of A MovieClip To Its Center

Mar 28, 2010

Can I set the registration point of a MovieClip (or other Display Object) to its center upon creation in AS3? the following

[Code]...

sets the registration point of myClip to its top left corner by default. Using Flash CS4 to set it to its center is just a couple of clicks, so I am wondering how I can perform the same action only with code.

View 3 Replies

Actionscript 3 :: Rotating A Sprite Around Its Center Point?

Aug 9, 2011

I searched online and found this script that is supposed to rotate and image but I'm not sure how to use, where to put in the degree angle that I want my sprites to rotate by. Also, I get an error. 1084: Syntax error: expecting identifier before leftparen. 1084: Syntax error: expecting rightparen before leftbrace.

var point:Point=new Point(spr_box.x+spr_box.width/2, spr_box.y+spr_box.height/2);
rotateAroundCenter(spr_box,45);
function rotateAroundCenter (ob:*, angleDegrees) {

[Cde].....

View 1 Replies

Flex :: Math - Rotate Point From A Given Center?

Jan 30, 2012

I'm trying to rotate a point in my Canvas from a given point (center). In my MouseDown handler, I save the point where user click (oldPos), and in my MouseMove handler, I'm doing this:

private function onMouseMove(event:MouseEvent):void
{
// Where the user pointer right now

[code]......

View 1 Replies

ActionScript 3.0 :: Set Registration Point To Loader At Center By Using It?

Dec 28, 2010

How Can i Set registration point to to the loader at the center by using as3 ?

View 5 Replies

ActionScript 3.0 :: Scale MC About Point In Center Of Stage?

Sep 8, 2011

basically just wondering if its possible to scale an MC about the center of the stage as opposed to the top left of the MC? I thought about setting the X & Y as stage width / 2 + MC width / 2 but cant as the user needs to be able to move the MC which is much bigger than the stage and zoom in on a point in the center rather than just the center of the MC.

View 2 Replies

ActionScript 2.0 :: Center LoadMovie Registration Point?

Dec 1, 2007

I'm trying to use Zoom transition for my photo Gallery which I'm using loadMovie "jpg" from Xml file.Now the problem is here. The Registration Point is set to the top upper left corner and I would like it to be in the center of my loadMovie.The Zoom transition only zoom from left corner and need to be center equal sides. How do I do this. My image size is "width 400px height 240px

View 4 Replies

ActionScript 3.0 :: Rotating Point Around Center Of Circle

Mar 9, 2009

I am trying to rotate some points around the center of the circle(0,0), however I'm getting weird values from the output. I've commented the problem code..

Code:
var r:Number = 10;//radius
var y:Number;
var x:Number;
var a:Number = 90;//angle of which the semi-circle is facing.. could be a random angle.
var ax:Number;//rotated points
[Code] .....

I am using the semicircle in BitmapData collision checking with getPixel(), with a moving circle...

View 1 Replies

ActionScript 3.0 :: Top-left Registration Point To Center Conversion (2D To 3D)?

Nov 16, 2010

I'm making a 3D room builder. The user places Sprites around the 2D stage and my script converts those Sprites to Papervision3D DisplayObject3D objects. I'm having problems with the 3D object positioning because Sprites have registration points at their top-left corner and 3D objects have registration points at their center. How can I make that conversion?ere's a scheme of how the 2 different coordinate systems work:

I've tried this code:
child3D.x = child2D.x;
child3D.z = child2D.y - child2D.y - child2D.y; // just to make it negative

[code]....

View 5 Replies







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