ActionScript 3.0 :: How To Scale (multiply) A Point In Oneline

Jun 19, 2011

I have a point which is 3,5 I want to scale, or multiply this point, by a factor of 5. To give me 15,25 What I'd really like to be able to do is: mypoint *= 5; but that doesn't work. I can't find any suitable method in the point class either. So what I'm trying to do now, which all research indicates should work, is:

[Code]....

View 3 Replies


Similar Posts:


Actionscript 3 :: Scale Around Point Using BitmapData?

Jul 2, 2011

I've searched but haven't found anyone wanting to do this with a bitmapData object.I'm using the following code:

matrix.identity();
matrix.translate(pan.x, pan.y);
matrix.translate(-zoomPoint.x, -zoomPoint.y);[code].....

Panning works, but using this method scale does not scale around my mouse.Has anyone done this successfully?

View 2 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 3 :: Flash - Center An Object Around A Point After Scale?

Oct 27, 2011

I've created an mc which functions as my map and controls to go with that which allow the map to be moved around and key points navigated to and zoomed in on at varying zoom levels.I'm using scaleX and scaleY to scale the map mc and a list of x and y positions to correctly position the map for each key point.When I want to go to a certain area I perform this calculation (offsetX and offsetY are the center of the screen):

newX = posX * scale + offsetX;
newY = posY * scale + offsetY;

Then I tween the position and scale of the map to smoothly scale and move the map to the correct position:

var tween = new TweenLite(_background, EASING_SPEED, {x:newX, y:newY,scaleX:scale.getScale(),scaleY:scale,ease:EASING_TYPE,onComplete:moveToComplete,onCompleteParams:[room]});

I now need to implement a zoom in / out function and this is what I'm struggling with. The zoom should use the center of the screen as the reg point for the scale, so I've been trying something along the lines of the following to get the correct positioning:

var newX = offsetX - (offsetX - _background.x) * scale;
var newY = offsetY - (offsetY - _background.y) * scale;

So in my mind this gets the distance from the current position of the map relative to the center point of the screen (offsetX, offsetY) then scales that distance by the new scale. However, this is clearly wrong because it's not working and the positioning of the map is wrong.I've also tried using a transform matrix to get the correct values but I know even less about them and not got the right results.

function scale(target:MovieClip, center:Point, scale:Number):Point {
var m:Matrix = new Matrix();
m.translate(-center.x, -center.y);//move the center into (0,0)

[code]....

View 3 Replies

ActionScript 3.0 :: Find Center Point Of Mc With Dynamic Scale?

Dec 1, 2010

I'm trying to add some zooming functionality. The problem is that when you zoom in and out, it scales the MC up and down from where the registration point is. This means That when I'm far from the position of the registration point instead of zooming the in straight it also makes it appear as if you are travelling towards the registration point.

To offset this effect I want to calculate the amount of pixels I need to offset the Map by so that it appears as if you are zooming in directly.

So just as a test I've put a little ball inside the map(called "center") which I'm trying to keep in the center of the map.[code]...

View 1 Replies

ActionScript 2.0 :: Scale A Beam To Mouse Co-ordinates/point?

Oct 23, 2008

I have attempted to make a movieclip scale in the y axis using _yscale but I can't seem to make it scale to the exact mouse co-ordinates.

Its within a rotating movie clip (controlled by the position of the mouse) and that works fine.

Here's the code I'm using at the moment.

Code:
onClipEvent(enterFrame){
var disty = this._y - this._ymouse
var dist = Math.sqrt(disty*disty)
this._xscale = 100 + dist;
}

View 6 Replies

ActionScript 3.0 :: Changing Object Properties (scale) Through Point?

Nov 9, 2009

I have developed a flash app in AS3 that allows you to drag objects around on stage, save,and load them. When the "save" button is pressed, it then loops through each item on the stage and gets the coordinates (x and y) for the bottom left corner and the top right corner. Code:

Code:
ActionScript Code:
var bottomLeft:Point = new Point(-50, -50);

[code]........

View 3 Replies

Actionscript 3 :: Scale A Dynamic Textfield In Flash From The Center Point?

Feb 16, 2010

I'm trying to make a text effect where on every frame the textfield increases in size and decreases in opacity. I'm using the scaleX and scaleY properties of my dynamic textfield to enlarge, but it's doing so keeping the left registration point fixed. I want to make it scale up radially outward, or with the center point fixed.

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

ActionScript 3.0 :: Way To Scale Up An Object From Its Center Even If Its Registeration Point Is At The Top Left?

Oct 3, 2009

1. Is there a way to scale up an object from its center even if its registeration point is at the top left? can that be done using TweenMax?2. can I apply the same tween on two objects at the same time? basically what I want to do is load up an image to the stage, and then tween its scale from 0 to the original size along with another movie clip behind it that would form some sort of a border for the image. and I want to scale them up from the center.

View 5 Replies

ActionScript 3.0 :: Change The Rotational/scale Point On A Object/sprite?

Jul 31, 2009

When you load a object through flash, you can set the rotational/scale point, but when you load it as a loader object or sprite, how do you change this point?

In this instance, I want to change the height of a sprite that is filled with a rectangle so that it shrinks down, not up.

Right now:

var colored_bar:Sprite = new Sprite();
with (colored_bar.graphics) {
beginFill(0x9e1819, 1);

[Code]....

The way I am doing it currently is moving the y position everytime I take away soem of the height, so it looks like it's moving down, but I'd think moving the orientation point at the beginning would be faster

View 2 Replies

ActionScript 3.0 :: Draw A Rectangle Or Circle Shape With Mouse And Scale By Setting The Point?

May 11, 2009

I want to make an editor like this site. [URL] If you browse this link you will find "Button. If you press this button you will navigate to a editor to design your layout. After draw a rectangle or circle or line you can resize that or can rotate that. When you finish if press the "you will back to the previous page where your desinged layout display. If you press the "" again then you will navigate the editor with the previously designed layout. I want to make a site like this. I want to use the flash cs4 to make the editor. Anybody knows how to draw a rectangle or circle shape with mouse and how to scale by setting the point and how to rotate by setting the rotation point also by using flash cs4 and as3?.

View 3 Replies

Flex :: Multiply All The Nodes With 3?

Feb 18, 2010

I write a code which is return the following XML which contain in a string type variable.

[code]...


Now i want to multiply all the nodes with 3 and again store in that string type variable. how can i do this?

View 1 Replies

Memory - Why Multiply By 8 For Flash

Jul 26, 2010

I was playing a flash game when a friend of mine showed me some Cheat Engine trick where you can search for integers in a flash game. eg your score is 100. To find the score, you'll need to search for the value 800 in Cheat Engine—this is probably a popular trick nowadays.I've never played with Cheat Engine before, but I understand that it's a memory editor? I thought it had something to do with bits and bytes; 8 bits = 1 byte, but I'm not sure at all.why you multiply by 8?

View 1 Replies

ActionScript 2.0 :: Preloading Multiply Swf?

Jul 11, 2005

The scenario is that I am making a site mith multiply swf files that I want to be preloaded in the background. For example, when you are on the main page, I want page 2,3,4 and 5 to be loaded during the time you se page 1. so fi you klick page 2 the preloaded continue the preloading process,, for the rest of the swf files

View 6 Replies

ActionScript 3.0 :: How To Load Swf And Multiply It

Aug 25, 2009

i must load one swf and multiply it 3 times. The swf is loaded (it is more than simple ) but the main problem is how to multiply it. I can't find method like duplicateMovieClip(). I need the animation and it can't be done with just taking the BitmapData of the swf. I try with some searches but no result for now. I think it could be done with creating a class runtime if it's possible.

View 3 Replies

ActionScript 3.0 :: Control The Blend.multiply Transparency Value?

Nov 3, 2010

Is there a way to control the blend.multiply transparency value?

code:

Code:
import flash.display.Sprite;
import flash.display.BlendMode;
var c:Sprite = new Sprite();

[Code]....

I know its kinda nonsense controlling this value, but what I m trying to achieve is a less "transparency" over the objects, but maintaining the multiply effect.

View 1 Replies

ActionScript 3.0 :: Photoshop Style Multiply Effect?

Feb 3, 2011

I've been playing with the color transform in actionscript and have discovered that using the multiplier functions it colors black areas and preserves white by default. I really need it work the other way around.

View 2 Replies

ActionScript 2.0 :: Randomly Resize And Multiply A Shape?

Dec 21, 2004

If you go to [URL] and check out the preloaders on the various pages, you'll see that when it reaches 100% many circles are randomly resized to eventually cover the whole preloader. I'm trying to do something similar to that effect using just Actionscript.

View 1 Replies

Actionscript 3 :: Flash SecurityDomain, P2P Settings And Multiply Swfs?

Mar 19, 2012

I have two swfs:application swf p2p client swf that allows to load data using rtmfp replicationtechnology (through cirrus service)The main idea is to have one p2p loader on the certain domain that will able to work in p2p network without asking many times for permission for each domain, so for instance:

application 1 (http://domain1.com/app.swf) |
application 2 (http://domain2.com/app.swf) | <--> p2p data loader (http://domainp2p.com/p2pcli.swf)

[code]....

View 1 Replies

ActionScript 3.0 :: Number Operations - Multiply 17.4*32.8 The Result Is 570.7199999999999?

Feb 13, 2011

I am working on a project where I need a lot of calculations.I found a really strange and very annoying problem in Flash: If you try to multiply 17.4*32.8 the result is 570.7199999999999 !!! This is just a single example.In this way my application looks buggy sometimes. What's the reason for this wrong result?In my application I don't want to round the numbers .

View 5 Replies

ActionScript 2.0 :: Math - Get Values(numerical) From An Xml Files And Multiply Them

May 19, 2003

I was wandering if I can get values(numerical) from an xml files and multiply them. Need a tutorial Something like this.

[Code]...

View 1 Replies

ActionScript 3.0 :: Make One Movieclip Multiply A Lot Times With A Max Number?

Aug 26, 2010

how can i have one movieclip but make it multiply alot times with a max number like maybe 10??

View 1 Replies

ActionScript 3.0 :: Multiply What A User Enters By Certain Number / When Button Is Pressed?

Aug 13, 2009

I am having a hard time finding a basic math tutorial. I am new to AS3 and just need to figure out how to multiply what a user enters by a certain number when a button is pressed.

View 1 Replies

ActionScript 3.0 :: Optimizing Multiply Layers With Blendmodes In Flex / Flash?

Nov 23, 2009

I'm working on some photo manipulation stuff and have multiple images loading and displaying ontop of each other, each with various blendmodes set e.g. overlay, multiply etc.

The problem is it is sooooo slow! I thought I might be able to optimise it by drawing the resultant image to a new bitmap using BitmapData.draw (so sort of pre-baking the effects). The problem is (as I understand it) blendmodes are not draw when not on screen, so I can't use this approach until I've added the images to the screen at which point it has already slooowed down.

View 0 Replies

ActionScript 3.0 :: Transparent Bitmap - Preload Images Then Multiply Them On Scene

Mar 5, 2008

what i want to do is to preload some images, then multipy them on my scene ( the files are transparent png containing clouds ) the problem is that when i copy the bitmap data to create a new cloud, i loose transparency, and i can't get WHY here's my code

[Code]...

View 6 Replies

ActionScript 2.0 :: Multiply Buttons On Scene On Release Goto And Wait

Jan 25, 2011

I have been really strugling getting my buttons working. I have one scene that have multiply buttons that shows from time to time on the timeline. My needs is that each buttons when released goes to an specific frame number (label) waits for 5 sec and then continue playing the scene from were it did stop and wait.

I have mamage to make the first buttons work, but when scene changes to the rest of the buttons on the timeline nothing happends. I have tried to place actionscript on an actionlayer (timeline), also tried to apply actions to each button. Same problem. I use actionscript 2. All buttons have instance name, and they shuffle, meaning that they show and dont show depending were on the timeline you are. This is for an adult site, so I am not sure that it is allowed to post an link to the flash scene.

View 1 Replies

ActionScript 2.0 :: Rolledover Clip To Scale Up And All The Others To Scale Down And Blur?

Mar 8, 2007

Scenario: main moveiclip with 4 other clips in it. I want the rolledover clip to scale up and all the others to scale down and blur.

Question: What is the most effiecent way to code this. Would it be a "for in loop"? I am trying to minimize the code and would rather not use a whole bunch of if then statements.

View 3 Replies

IDE :: Flash Content To Scale When Scale Browser Window?

Feb 19, 2010

I want my flash content to scale when I scale my browser window.

View 5 Replies

ActionScript 2.0 :: Initialize X Scale And Y Scale Into Percentages?

Jan 14, 2006

How can I convert the current scale of the instance to 100% so I can easily "visualize" and manage the instance when I modify its scale? Here's the actionscript, it works, but I just want the temp._xscale and temp._yscale to be in percentages, not real numbers.

Code:
USflag.onMouseDown = function ()
{
var temp = USflag;
onEnterFrame = function ()

[code]....

One last thing, what's the tag you have to put that is designed for boxing actionscripts? I'm suing [ code ][ /code ]

View 1 Replies







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