ActionScript 3.0 :: Scaling Math - Zoom Into The Map The Labels Marking Items On The Map Remain The Same Size

Mar 4, 2011

I've got a map that you can zoom in and out of. What I'd like is that are you zoom into the map the labels marking items on the map remain the same size. Initially I did this successfully by making the labels independent movieclips(ie not children of the map mc) and then using localToGlobal to make sure they were in the right position. However I found that there was a bit of lag in their movement compared to the movement of the map.

So I thought what I'd try is to make the labels children of the map and then scale them up and down inversely to the scale of the map. However I haven't been entirely successful. I'm having difficulty finding the equation to make it scale up and down correctly in proportion to the map. The problem is that my labels are scaling in a linear fashion while my maps scaling isn't.

[Code]....

View 0 Replies


Similar Posts:


ActionScript 2.0 :: Clip Scaling - Each Letter To Start Of Larger Than It Should Be And Zoom Out (scale Down) To The Normal Size?

Feb 2, 2004

i got a logo, each letter it a clip, cos the logo is bit more than just text, but thats beside the point. I want each letter to start of larger than it should be and zoom out (scale down) to the normal size, pref with a bit of a bounce at the end, so it goes from very big to, slightly smaller then proper size, to proper size, get it? with help from Master64 (via IRC) i worked out that i could use _xscale and _yscale (i am relativly new here, lol ) but the problem i got is that it scales, but in huge jumps, not smooth.The class is ment to be reusable (duh!) so my concept is

Code:
start_width = 90
speed = 50[code].....

View 7 Replies

ActionScript 3.0 :: Math Scaling To Resolution?

Jul 27, 2009

Ok this is more of a math issue than an AS issue, but in flash player 10 you can have an area of less than 16777215 pixels in order to make a BitmapData. The problem is I have an image bigger than this and for some reason I can't logically develop an equation that will take an image bigger than the resolution and scale it down so it's right under it in, and was curious if anyone has done this before.

Example: if i was trying to get something under 5,000 pixels and I had an image 300x60 that is a resolution of 18,000 what multiplier would i use on the height and width of the image so it stays the same aspect ratio and stays under 5,000 pixels.

View 4 Replies

ActionScript 3.0 :: Do A Math.random On Selecting A Certain Number Of XML Items?

Jul 5, 2009

anyway to do a Math.random on selecting a certain number of XML items?

View 8 Replies

ActionScript 3.0 :: Pinch Zoom Scaling Boundary?

Apr 12, 2011

I am trying to achieve a pinch zoom effect on an image dynamically added to the stage via actionscript.

the images natural size is 2048x and onload is scaled to 1024x

when the pinch zoom is performed it calls the function below.

the problem i am trying to solve (and have tried numerous things) is to ONLY have the image scale between the two sizes as mentioned above.

scale between 1024x and 2048x and not go larger or smaller than.

[Code]...

View 2 Replies

Flex :: Send The Names/labels Of Selected Items From A List To A Php File?

Oct 28, 2009

I know i can access multiply selected options of a list by

var selectedAlgos:Array = algosList.selectedItems;

where algosList is the name of my List.

How to i send this array via HTTPService to a phpfile and how can i then access the elements of this array from the php file?

View 1 Replies

ActionScript 3.0 :: Flash Matching Items In An Array To Movie Clip Labels?

Feb 6, 2012

I have an array that holds a list of items. In a movie clip, I have that same list as the frame labels. I'm using a for loop to iterate through the array and then assigning event listeners so that when you roll over an icon, it sends the movie clip to the right frame label (matching the item in the array).

However, the code I have now only returns the first match and not any of the others. Here's my code:

Code:
for (var j:uint = 0; j<interiorCallouts.length; j++) {
featureTextArray[j].text = interiorCallouts[j];
featureArray.length = interiorCallouts.length;

[Code]....

See the showCallout function. I'm using the interiorCallouts array to match the frame label in the callouts_mc, but I'm only getting the first match. None of the others.

View 4 Replies

ActionScript 3.0 :: Zoom On Panning Class - Cannot Seem To Get The Image To Scale Without Also Scaling The Container _rectangle

Aug 27, 2010

I'm trying to add zoom functionality to Lex Talkington's great Panning Class HTML Code: [URL] and have run into the following issue: I cannot seem to get the image to scale without also scaling the container _rectangle. Here's my code

[Code]...

View 2 Replies

ActionScript 2.0 :: Rotating/scaling Menu - Items Arranged Vertically?

Apr 18, 2005

I'm trying to build a set of menu items arranged vertically, and to be able to change their scale and position according to the current item selected, giving it some sort of depth effect. found a little bit about scaling menus, and used a script(nothing explained much, just cut and paste) that changes alpha an size of the menu items. I managed to add a swapDepths to bring to front the current item. I need now to figure out how to make the first item full size/alpha on load, move the items to make it look like they're rotating backwards, and get them to stay on their states when one of them is pressed (that is, one at full size/alpha and the others faded and smaller).The test file i'm working on can be downloaded from here, it's in FMX format.

View 2 Replies

ActionScript 2.0 :: How To Zoom In An Image The Same Size

Jan 31, 2003

how to zoom in an image the same size and move.... for example, [URL] on the site menu.

View 4 Replies

ActionScript 1/2 :: Button Size Constant During Zoom?

Jan 6, 2010

Flash map with a number of flash created vector buttons sitting over it. I wish to keep the button size from changing during a users zooming in/out on the map we have, i.e button remains 5mm wide whatever the zoom. Is the solution to this in coding and what code do I use ?

View 5 Replies

ActionScript 1/2 :: Scaling SWF To Less Than Or Equal To Original Size

Apr 1, 2010

how to scale a SWF in the browser window, but not larger than the original stage size in the FLA file?  For instance, I've designed a course in Flash with stage size of 1024x768 in Flash.  In the published HTML document, I change the following values:
 
'width', '1024' changed to 'width', '100%'
'height', '768' changed to 'height', '100%'
'scale', 'noscale' changed to 'scale', '100%'
 
These changes in the HTML source code allow the SWF to size with the browser, but I don't want the SWF to grow larger than 1024x768 if the browser window is greater than these dimensions.  I want the max size of the SWF to be 1024x768 regardless of the browser window.
 
how to achieve this in the HTML source code and/or AS2?

View 3 Replies

ActionScript 3.0 :: Scaling X And Y Size Of Stage When Published

Apr 26, 2011

How do you do this in AS 3.0?I did it in AS 2.0 with the following code:this.onLoad = function () { this._xscale = 133.33; this._yscale = 166.70;can get it working for AS 3.0.

View 2 Replies

ActionScript 3.0 :: Scaling MovieClip Size - Width Of Stage

Jun 21, 2011

Is there any performance difference? I am scaling a 2000 - 4000 wide movieclip, within a 600 wide stage. Does it matter which way I scale it in terms of CPU usage;
myMovieClip.scaleX *= 2;
or
myMovieClip.width *= 2;
The movieclip will be scaled multiple times and to varying sizes.

View 5 Replies

ActionScript 2.0 :: Scaling Background & Fixed Size Foreground?

Feb 3, 2006

Is it possible to have a single jpg (1024x768) scale up & down with the browser window (no matter the aspect ratio, stretched to 100% browser width/height), while keeping the foreground content (most likely added via loadMovie) in a fixed scale and centered on the screen? An example can be seen on the Second Story home page.

View 9 Replies

ActionScript 3.0 :: Scaling Movie Clips To Window Size?

Feb 22, 2009

I have a flash document with movie clips in it that i want to scale depending on the monitor or window size. it looks great on 1024 x 768.....but not on small laptops

View 6 Replies

ActionScript 2.0 :: Scale And Zoom - Back To Its Original Size And Position?

Apr 19, 2004

how i could create a function to do the following. I have a mc and when you click on it i want it to scale too say 150% and move to a different x y position, then when you click on it again i want it to go back to its original size and position.

View 3 Replies

ActionScript 2.0 :: Scaling TextArea Component To The Size Of The Browser Window

Sep 20, 2004

I'm using the textArea component, but i want to scale it to the size of the browser window. The problem is it scale the content(xml+css) and the scrollbar, and i want to just change the size. I've also tried to attach the Component and then setting the size, but that give the same problem.

View 3 Replies

ActionScript 3.0 :: Flash Scaling Size Of Source Image For Server?

Dec 5, 2010

I have code that allows users to upload images, which are of any dimension and file size, and have applied that data to a bytearray and a loader class, which is then displayed and saved to the server. The server has a memory size limit per file of 256k. Everything works well unless the image is too big. How to change the size of that source image so the server will accept it. I've been trying to assign the loader data, or the bytearray, to a Matrix, or a Bitmap, or a BitmapData, figuring one of these can scale the dimensions of the image which will bring down the file size. (To be completely clear: this isn't movieclip.scaleX -- that doesn't affect the size of the source image)

Code:
var _clickMe:ClickMe = new ClickMe();
var _imageLoader:Loader=new Loader();
var bytes:ByteArray=new ByteArray();
var fileRef:FileReference = new FileReference();
var _faceBitmap:Bitmap = new Bitmap();
[Code] .....

View 3 Replies

ActionScript 2.0 :: Scaling Background Image To Size Of Browser Window

May 7, 2005

I am trying to scale a background image to the size of the browser window. For some reason it does not fill the entire stage?

Stage.scaleMode = "noScale";
Stage.align = "TL";
background_mc._width =Stage.width
background_mc._height =Stage.height
background_mc.onResize = function() {
background_mc._width = Stage.width
background_mc._height = Stage.height
} Stage.addListener(background_mc);

View 1 Replies

Packing Fixed-size Rectangles Inside A Circle With Biggest 'zoom'

Sep 9, 2011

I need an algorithm to place a set of N rectangles inside a circle for radius R, so that they can scaled up to the biggest possible size that doesn't exceed the border of the circle.

View 1 Replies

ActionScript 2.0 :: Loader Component Handy In Loading JPEGs And Scaling Them To The Specified Size

Dec 13, 2004

I've found the loader component handy in loading JPEGs and scaling them to the specified size. However, I've found it a little annoying that when the image is loaded, sometimes you can see the image in it's original size for a fraction of a second before it's resized to fit the loader. Is there any way to avoid this -- such as the loader only being visible after the image is resized?

View 1 Replies

Removing Unused Items / Optimizing File Size?

Jun 3, 2009

I have a large swf that is embedded in Director as a sprite I now want to put it onto a web page, so file size is critical Is there a way to remove unused library items when publishing so that file size is reduced?  Is there another way to compress the swf so it is much smaller?The current size is about 25 Mb.What about streaming the swf?I'm not talking about streaming video or audio, just any Flash content.In Director, there is a way to right-click on a cast member and choose "find in score".If something isn't found it means that it either is not used in the movie or is implemented through code

View 3 Replies

IDE :: Optimizing File Size / Removing Unused Items?

Jun 3, 2009

I have a large swf that is embedded in Director as a sprite. I now want to put it onto a web page, so file size is critical. Is there a way to remove unused library items when publishing so that file size is reduced? Is there another way to compress the swf so it is much smaller? The current size is about 25 Mb. What about streaming the swf? I'm not talking about streaming video or audio, just any Flash content. Any tricks for speeding the process up so that the user doesn't have a long wait before the swf starts?In Director, there is a way to right-click on a cast member and choose "find in score". If something isn't found it means that it either is not used in the movie or is implemented through codeIs there a similar way in Flash of detecting unused items or automatically eliminating them when publishing?

View 1 Replies

ActionScript 3 :: Flash - Math.floor Acting Like Math.round?

Mar 7, 2011

Here is the problem:

var p:int = 0;
var n:Number = 0;
n = 32.999999999999999;
p = Math.floor(n);
trace(p); // returns 33
n = 32.11111111111111;
p = Math.floor(n);
trace(p); // returns 32

I would expect both of these to return 32. I have searched, and it seems this is an unreported bug in AS3. Or ... am I doing something wrong?

View 4 Replies

Actionscript 3 :: Modulus / Grid Layout With Items Of Changing Size

Mar 3, 2011

I'm trying to figure an elegant way to display a certain number of items in a grid. I have a feeling the answer lies partly with modulus, but it's a little more complicated than that. I know how to lay out items in a grid based on a set number of columns. Something like this:[code]but what I want to do is set things up such that if there is only one item (j=0), the image covers the entire available area (stage.Width and stage.Height or, for simplicity, 1000px, and 500px). If there are 2 items, there should be 2 columns, with the images taking up half the width of the stage and all of the height (500x500), 3 items - 3 columns (300x500), 4 items - 2 columns & 2 rows (500x250), and so on, keeping a balanced grid layout but decreasing the dimensions of the items and increasing the number of rows in some sort of logical and balanced manner.

View 1 Replies

ActionScript 3.0 :: Changing Size Of Mask In Slider To Display More Items

Jul 14, 2011

I found this tutorial: [URL]. It works great but I wanted to add a little more to it. Currently it works with only one item displayed at a time. If I want to display more than one item, let say 2, I make the mask the size of the 2 items. The back button works fine because the X position is still the the same. However the next button does not account for the size of the mask and works like it did before.

View 3 Replies

ActionScript 2.0 :: What Is The Diffrence Between Math.floor And Math.round

Sep 26, 2005

Wat is the diffrence between these two?

View 2 Replies

Flash8 :: Marking Some Nodes As Checked?

Nov 26, 2011

I have struggled through making an application that displays sequentially, through the use of next and previous buttons, information derived from an XML file that is presented in four different text fields. I would like to be able to "select or mark" some of the nodes as having been examined through double-clicking
or dragging and dropping them in a certain target area.

When I double click on the name field, I am looking for two things to happen:

1. The text color in all four displayed fields to change and keep the new color.

2. Have the information displayed transferred to another XML and a text file to be used elsewhere.

View 21 Replies

ActionScript 2.0 :: Marking A Node As Checked?

Nov 27, 2011

I have struggled through making an application in flash 8 / AS 2 that displays information derived from an XML file sequentially, through the use of next and previous buttons, and is presented in four different text fields. I would like to be able to "select or mark" some of the nodes as having been examined or checked either through clicking or dragging and dropping them in a certain target area. When I double click on the name field, I am looking for two things to happen:1. The text color in all four displayed fields to change and keep the new color.2. Have the information displayed transferred to another XML file and a text file to be used elsewhere.

View 2 Replies







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