Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Elastic Scale An Object With Actionscript



Anybody can help me with an function which can do this .. in the last few hours I searched google ad tried to modify some other examples .. from _x to _xscale .. but none ware working .

I could not find a function to make an elastic zoom (scale).



DevShed > Flash Help
Posted on: November 24th, 2006, 07:53 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Boing-boing Elastic Scale Actionscript
Hello.
Im using Flash MX.
Im making a flash map of Australia and the map is divided ino regions. When the cursor is in overstate over a region it boings out using the elastic scale actionscript.
The problem I have is that when I move the cursor over a neighbouring region it boings out and the first one boings in and they overlap a few times.
im looking for a a solution so that if the cursor is in an overstate in the neighbouring region - it doesn't boing out until the first region is stable and not moving or has stopped boinging.
Would clicking on each region rather than an overstate solve the problem or is there anything else? I dont want users clicking on the map - just placing their cursor over a partcular region.
Im lokking for a concrete actionscript. or something I could adapt.

__________________________________________________ ___________________

Movieclip.prototype.elasticScale = function(target, accel, convert) {
xScale = xScale * accel + (target - this._xscale) * convert
yScale = yScale * accel + (target - this._yscale) * convert
this._xscale += xScale
this._yscale += yScale
}
__________________________________________________ ___________________

Each region action
__________________________________________________ __________________
onClipEvent (enterFrame) {_visible
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
elasticScale(150, 0.29, 0.5)
} else {
elasticScale(100, 0.29, 0.5)
}

}
__________________________________________________ ___________________


Thanks.
Rafal

How Do I Scale An Object Using Actionscript?
hi,

I would like to mouse over an object and let some other objects become smaller at the same time. How do I do that in actionscripts?

I also want to see the object animating to become smaller and then back to the original size once there is a rollout.

thanks.

Lawrence

Elastic Scale?
can anyone provide a simple actionscript that scales an MC like an elastic. very simple, kind of a bounce effect. the ones that i have found are all tied into button behaviors// cant get them working on their own. thanks.

Help Me With This Elastic Scale..anyone : )))
Hi there, I know that this has been debate all over the board but I need a bit of help on.
basically I can move the mc on stage thanks to this code I've used few time but I'm trying to scale the object on X and Y once it reach
his position. Like >

button go> X (or Y) pos go> then scale in to XY dimension.
Hope it is quite clear. I remember there was a code for this but cannot find it anymore around the board.
Any help appreciate.



rolleyes:

Elastic Scale Question
Hello,

i have this elastic scale prototype. I want to make a MC scale elastic when i roll over it.
I am having problems in how to apply the enterFrame command.
I don't know how i should do this.

Here is the code which scales elastic.

Can u give me a hand?


Movieclip.prototype.elasticScale = function(targetMC, accel, convert){
this.xScaled = Math.round(this.xScaled * accel + (targetMC - this._xscale) * convert);
this.yScaled = Math.round(this.yScaled * accel + (targetMC - this._yscale) * convert);
this._xscale += this.xScaled;
this._yscale += this.yScaled;
}

Thanks,
Miguel

Elastic Scale Issues
I have some elastic scale code that I'm using, and it works for the most part. The actions in the first frame are the common:


Code:
Movieclip.prototype.elasticScale = function(target, accel, convert) {
xScale = xScale * accel + (target - this._xscale) * convert
yScale = yScale * accel + (target - this._yscale) * convert
this._xscale += xScale
this._yscale += yScale
}

stop();
And there's a movieclip with this code on it:


Code:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
elasticScale(120, 0.7, 0.3);
} else {
elasticScale(100, 0.7, 0.3);
}
}
And it scales/bounces perfectly. Problem is, once I add another movieclip with the same clipEvent actions, this second movieclip enlarges as is should *but also* makes the first movieclip jiggle. Any way to prevent this from happening?

Elastic Scale Prototype
Hi all,

Enjoying messing about with prototypes and am attempting to create a useful little library of prototypes for use with movieclips (like fadeIn/out, play/reverse etc). Most of these have some sort of onEnterframe function going on with them, so each works within a dynamically created movieclip which I'm hoping will enable me to direct multiple proto functions to movies without them screwing each other up. That's the theory anyway and, as usual, I'm flying by the seat of my pants.

The one that's causing me problems is the elastic scale one - and I've posted the movieclip in the hope that someone can tell me what's wrong with the code. The actual code to enact the elastic effect was obtained somewhere on Flashkit by Jae Young, but the proto is mine. What appears to happen is that if you sequentially direct the elastic proto at 2 or more objects sequentially they definitely interefere with each other or screw up completely and I don't know why it's doing this....

I've posted the file if anyone wants to take a look at it to see what happens. Below is the code for my prototype and also Jae Young's original code.....Any help or advice is always appreciated.


ActionScript Code:
//my proto code
MovieClip.prototype.elasticScale = function(target, accel, convert) {
    var theTarget = this;
    scaleElasDepth = 995;
    myMovie = theTarget.createEmptyMovieClip("scaleElasMovie", scaleElasDepth);
    myMovie.onEnterFrame = function() {
        xScale = xScale*accel+(target-theTarget._xscale)*convert;
        yScale = yScale*accel+(target-theTarget._yscale)*convert;
        theTarget._xscale += xScale;
        theTarget._yscale += yScale;
                if ((xScale<0.05) and (xScale>-0.05)) {
            delete this.onEnterFrame;
        }
    };
};


ActionScript Code:
//jae young's original code
  //SET PROTOTYPE FUNCTION IN FIRST FRAME
Movieclip.prototype.elasticScale = function(target, accel, convert) {
      xScale = xScale * accel + (target - this._xscale) * convert
      yScale = yScale * accel + (target - this._yscale) * convert
      this._xscale += xScale
      this._yscale += yScale
}

  //USAGE ON MOVIECLIP
onClipEvent (enterFrame) {
      if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
            elasticScale(target scale, accel value, convert value)
      } else {
            elasticScale(target scale, accel value, convert value)
      }
}

Elastic Zoom (scale)
How to make several MCs to zoom in on mouse over and zoom out to itīs original scale on mouse out??? all this with actionscript and with some ease (elasticity) to make the motion more natural?

Thanks

This Elastic Scale Menu
Hi Guys,

please, need help with this one.

http://www.dhondt-deuren-trappen.be/

Does anybody know how to create this elastic-sale menu, i think there was tutorial or fla for this....
I can t geet this one right.

SO PLEASE HELP !!!

1000 thanks

Elastic Zoom (scale)
How to make several MCs to zoom in on mouse over and zoom out to itīs original scale on mouse out??? all this with actionscript and with some ease (elasticity) to make the motion more natural?

Thanks

This Elastic-scale Menu
Hi Guys,
First time here so HI EVERYBODY and it is nice to be here. Respect to the admin, moderators and members.

please i need help with this one.

http://www.dhondt-deuren-trappen.be/

Does anybody know how to create this elastic-sale menu, i think there was tutorial or fla for this....
I can t geet this one right.

SO PLEASE HELP !!!

1000 thanks

Elastic Scale Conversion To Flash 8-9 ?
hi everyone,
I've found a script that I whant to run it to a website. but first I need to publish the animation to flash 8, at least. If I choose to publish the animation to a verions of flash bigger than 5, then the script don't work properly or don't work at all.

here is the example of the script that work just fine on version 5 published.
http://89.165.184.24/tmp/elastic_scale.html
also the fla is downlodable

anyone can help ?
thank you very much































Edited: 12/03/2006 at 01:47:54 PM by costin

Easy Preload, Scale Bar Using The Tween Or Elastic Style..
need the expression for scale a bar preloader using the elastic style or tween style. Do u can help me, please? thanks

Dragable Object On The Elastic Line Tutorial?anyone
Hi all.,

i have a question but have no expamle so i'll try to decribe what i am looking for in the best way that i can.

c like this...

long time ago i ran into this tutorial of how to experiment with flash physics but i kinda lost it and i need it desperatly.

heres what i need

imagine the thin line that goes from one edge to the other edge of the browser (and i know that there is a function called drawLine or something like that in flash...and that was not a problem to make)

on that line in the middle of the browser imagine 4 objects lets say 4 balls .so each ball is connected with the other with line..

fun part is that each ball is draggbale object that when draged streches the line that connects ball next to dragged one..and after release ball comes to its original position. with bouncing effect offcourse.

PLEASE help.

If that is not enough i can draw a picture to explain it.

Thank you all in advance.

OH almost forgot.. am not some bad ass actionscripter so please have patience.

Peace

Draggable Object Attached To Elastic Like Hose... Help
Hi,

This is my first post, I am trying to play with draw nodes and draw api actionscript. What I am trying to make is a gas pump in flash where the user can drag the nozzle off the pump with an elastic like hose attached to it.

I found this tutorial: http://www.emanueleferonato.com/2007...me-with-flash/ , which is exactly what I want except I want more of an elastic like feel to the hose... I also found this which has the elastic effect but it follows the mouse rather than drag and drop: http://www.kirupa.com/forum/showthread.php?t=210193

Any help would be greatly appreciated

PS: I would also like the nozzle to be limited!

Actionscript 'elastic'
Hi,
I want to know a script for flash mx.
I'm not good in actionscripts (and english )
the script I want to see is like the follow description :

I have a couple of lines (horizontal or vertical didn't figured it out what is the best) and I want to put a IMG on it.Oke that was simple but I want them to move onto the lines and a little of the line and when its too far it go back to his original place with a elastic effect.

I hope you can help me and sorry for the bad english (if it is bad)

neocotic.

BTW: i think this is in the worng section :/

Inertia And Elastic ActionScript
can someone teach me how to create inertia and elastic effect ?

Actionscript For Elastic/bendy Lines
Does anybody know of some action script that will make a 1px. line bend as though it is made of elastic? I can draw a line but can't seem to animate it without tweens
Help please needed as this has been going on two long

this is the script to draw aline by the way

this.createEmptyMovieClip("newPage_mc", 1); // creates an empty movie clip
newPage_mc.lineStyle(3); //sets the stroke to 3
newPage_mc.curveTo(50, -100, 100, 0); //draws the curve

Actionscript Interactive Elastic Motion
I used to be able to create elastic animation interaction in AS1. . but with AS2 I'm unable to use it (via prototypes).

I want to have a few navigational elements which will animate with a bit of elasticity on rollover. . i used to invoke a function like this. .

Movieclip.prototype.rubberBand = function(targetX, acc, convert) {
this.xPos = this.xPos*acc+(targetX-this._x)*convert;
this._x += this.xPos;
// updateAfterEvent();
};


Does this make any sense?

Thank you in advance. .

[F8] ActionScript Help For Elastic Slider And Preloader
Hey All,
I threw my hat into the world of Action Scripting but none of my stuff seems to work properly I could really use some help and concerete examples as I am so confused. I have a preloader I am not sure if it is the most effective way to make the shape grow into what I want. After loaded, I want it to load my slider navigation menu which doesn't seem to work and I have no clue why. Any help would be greatly appreciated!

Elastic Vector Line W/ Actionscript?
Hi Guys,

I am interested in creating the effect used on this site for the mouse CORD...

http://dontclick.it/

The mouse follow effect is kind of a no brainer... but I am going after the effect they are creating with the cord. I am sure it is quite simple, I could just use a bit of help in figuring it out. Links to other examples or TUTORIAL would be great too...

Thanks!

Scale An Object To 100 Percent
I want help in scaling an object

I first have to determine what is the current scale value and based on that I have to scale the object upto 100 percent. Ths scale factor can initially be eiter less than or more than 100

can someone help me out with this ?


!!!!


I got the solution for it

Thanks

[Edited by mhari on 07-06-2001 at 06:53 AM]

Y Scale A Draggable Object, Please Help
I am tryng to make a draggable object get smaller as it is dragged up the screen, as in going into the distance, I would like a smooth dynamic effect. Does anyone have a tutorial or FLA they can share? I have had people give me parts of the code but I am pretty new at action scripts and need the entired code. Thanks with any help!!
R. Hamm

Mouseaction-scale Object
Hi
I am trying to create a swf file that scales an object at constrained proportions when the cursor moves from side to side. I am able to make the movie clip(object) scale near and far, but can't make it constrained. Any suggestions are greatly appreciated. Here is the code I've been working with.

thanks
piper
________Code from movie clip......
x = _x;
y = _y;
xf = int((x*100)/550)-50;
yf = int((y*100)/400)-50;
if (Number(xf)<0) {
xf = -xf;
} else if (Number(xf)<2 and Number(xf)>=0) {
xf = 2;
}
if (Number(yf)<0) {
yf = -yf;
} else if (Number(yf)<2 and Number(yf)>=0) {
yf = 2;
}
setProperty ("/b", _xscale, xf*5);
setProperty ("/b", _yscale, yf*5);
setProperty ("/a", _xscale, xf*5);
setProperty ("/a", _yscale, yf*5);
setProperty ("/a", _width, xf*50);
setProperty ("/a", _width, yf*50);

Resize Object To Scale?
Hello,

What is the code to resize an object to scale? i.e. I know how to resize using setProperty("_root.Place.Test.Pic1",_width,"1000") ;. But this will distort the image i want the image to stay to scale.

Thanks.

Drag/Scale Object Help
Hey all,

Trying to fine tune, if possible, a drag scale movie clip functionality. I'm trying to get it to scale on the arrow instead of the whole image. Here is the code...

var OnScale:Boolean;

display01A.imageBg.imgArw.addEventListener(MouseEv ent.MOUSE_DOWN, sclStart, false, 0, true);
this.display01A.addEventListener(MouseEvent.MOUSE_ UP, sclStop, false, 0, true);
this.display01A.addEventListener(Event.ENTER_FRAME , onLoop, false, 0, true);

function sclStart(evt:MouseEvent):void {(OnScale=true);
}
function sclStop(evt:MouseEvent):void {(OnScale=false);
}

function onLoop(evt:Event):void {
if (OnScale)
{
this.display01A.width = Math.max(mouseX - this.x, 10);
this.display01A.height = Math.max(mouseY - this.y, 10);
( this.display01A.scaleX > this.display01A.scaleY ) ? this.display01A.scaleY = this.display01A.scaleX : this.display01A.scaleX = this.display01A.scaleY;
}
}

I can provide an fla if desired. Thanks in advance.

http://www.geocities.com/oezian/drap_scale.swf

Can Tweener Scale An Object?
Hi,

I have a movieclip that draws a rectangle that I want to start as 0px height and get to 200px height.

wrap.graphics.clear();
wrap.graphics.beginFill(0x999999);
wrap.graphics.lineStyle(2,0xFFFFFF);
wrap.graphics.drawRoundRect(490,175,260,230,20,20) ;
wrap.graphics.endFill();

Is there a way to do it with the Tweener class?

Thanks,
Cgull

Drag/Scale Object Help
Hey all,

Trying to fine tune, if possible, a drag scale movie clip functionality. I'm trying to get it to scale on the arrow instead of the whole image. Here is the code...

var OnScale:Boolean;

display01A.imageBg.imgArw.addEventListener(MouseEv ent.MOUSE_DOWN, sclStart, false, 0, true);
this.display01A.addEventListener(MouseEvent.MOUSE_ UP, sclStop, false, 0, true);
this.display01A.addEventListener(Event.ENTER_FRAME , onLoop, false, 0, true);

function sclStart(evt:MouseEvent):void {(OnScale=true);
}
function sclStop(evt:MouseEvent):void {(OnScale=false);
}

function onLoop(evt:Event):void {
if (OnScale)
{
this.display01A.width = Math.max(mouseX - this.x, 10);
this.display01A.height = Math.max(mouseY - this.y, 10);
( this.display01A.scaleX > this.display01A.scaleY ) ? this.display01A.scaleY = this.display01A.scaleX : this.display01A.scaleX = this.display01A.scaleY;
}
}

I can provide an fla if desired. Thanks in advance.

http://www.geocities.com/oezian/drap_scale.swf

Drag/Scale Object Help
Hey all,

Trying to fine tune, if possible, a drag scale movie clip functionality. I'm trying to get it to scale on the arrow instead of the whole image. Here is the code...

var OnScale:Boolean;

display01A.imageBg.imgArw.addEventListener(MouseEv ent.MOUSE_DOWN, sclStart, false, 0, true);
this.display01A.addEventListener(MouseEvent.MOUSE_ UP, sclStop, false, 0, true);
this.display01A.addEventListener(Event.ENTER_FRAME , onLoop, false, 0, true);

function sclStart(evt:MouseEvent):void {(OnScale=true);
}
function sclStop(evt:MouseEvent):void {(OnScale=false);
}

function onLoop(evt:Event):void {
if (OnScale)
{
this.display01A.width = Math.max(mouseX - this.x, 10);
this.display01A.height = Math.max(mouseY - this.y, 10);
( this.display01A.scaleX > this.display01A.scaleY ) ? this.display01A.scaleY = this.display01A.scaleX : this.display01A.scaleX = this.display01A.scaleY;
}
}

I can provide an fla if desired. Thanks in advance.

http://www.geocities.com/oezian/drap_scale.swf

Object Scale Up As Mouse Approahces?
Ok..i hope I can explain this.

If i have a list of words (or objects all in a line) how can I get them to begin to grow as the mouse approaches to them? And i don't mean putting an MC in the over state of a button that has the object get bigger. I mean as the mouse passes over the words or objects, they grow. For example:

The best example I've seen is not even flash...it's the icons on the dock on a MAC (OSX). Anybody know what I'm talking about?

Yet another overly elaborate post from me...but I'm learnin'!!

thanks everybody.
>PHER

Scale Object As Mouse Approaches?
Ok..i hope I can explain this.

If i have a list of words (or objects all in a line) how can I get them to begin to grow as the mouse approaches to them? And i don't mean putting an MC in the over state of a button that has the object get bigger. I mean as the mouse passes over the words or objects, they grow. For example:

The best example I've seen is not even flash...it's the icons on the dock on a MAC (OSX). Anybody know what I'm talking about?

Yet another overly elaborate post from me...but I'm learnin'!!

thanks everybody.
>PHER

How Do I Scale A Draggable Object On Rollover?
Hey - and thanks to anyone who can help me!
I am creating a children's interactive click-and-drag activity. They will click on objects and drag them to the correct location. The only problem is I have so many objects that I had to scale them all down in order for them to all fit on the screen. How do I make it so when they rollover on the object, it increases to the correct scale (and stays that way) so they can then position it to the right place in the movie? Not sure if my objects need to be mc's or buttons for this to work. Any help MOST appreciated!

Scale An Object WITHOUT Scaling The Keyline?
I am trying to scale a box object on the state that I've used in different instances to highlight relevant information. The areas are all different sizes, and I'd like to use different instances of the same movie clip with the box object.

The problem is my box object has a 2px keyline around it, and when I scale my movie to fit the various areas to be highlighted, my keyline also scales, which is ruining the look.

Anyone know a way around this?

Gordon

How To Dynamically Scale An Object On Mouse Over
Hello, I'm new to the forum and I'm here to hopefully get help from the experts.

I'm trying to get the same effect as this page:

http://www.futureofthebook.org/blog/..._design_j.html

can anybody help?

Thanks in advance,

Z

Object Following Mouse On Y-scale And Get Back
To best describe my issue: I want an object to follow a mouse on Y scale. I have done it by using this code


Code:
slide_mc.onEnterFrame = function (){
with(this){
distY = (_root._ymouse - _y);
_y += distY*0.15;
}
}
However, there are few issues+questions:
1) when loads it moves up. It should stay in start position. How to keep it stay at the same place?
2) half of the line dissapears when it goes too far to top or bottom. Is there a way to limit how far the that object can go?
3) I want it to go back to start position if mouse is not in area. How do make the object do that?

so far what I have done you can see here

Mouse-driven Object Scale
Hello,

I'm trying to create an effect in Flash MX:
I have a number of graphic objects (movie clips) clustered on the Stage. What I need is when the mouse clicks on an object, that object scales up to a pre-determined value (say 200%) - when the mouse rolls off the object, it scales back down to its original size. I've been trying to figure out the Actionscript for this, but with no luck. It's important that the scaling be gradual and not just a sudden increase/decrease. Just to confirm:

a) OnRollOver - no change
b) OnClick - object scales up
c) OnRollOut - object scales back down

I would be very grateful if someone can give me the AS code to do this. Thanks in advance!

Benny

Scale Video Object From Center
Is it possible to scale a video object from it's center? I am currently using the below code to resize but I need it to scale from the center of the video object.

ActionScript Code:
function resizeVideo() {
video._width = video.width;
video._height = video.height;
}

Scale Object Beyond Anchor Point
Hello

I have a big square with the anchor point set to the top left corner. To the right, left and bottom of this square I have collapsing menu's.

So I have been able to work with the right and bottom just fine by increasing the _xscale and _yscale But how do I increase the scale of the square to the left when the anchor point is set there? Or what is the solution?

Sandman9

Loading Variables From Txt File, Scale Object According To Value?
I'm relativly new to actionscript, but I'm getting along well enough with it.

The problem I have right now is that I'm trying to make a dynamic shockwave file which loads updates for the site out of a text file. I've managed well enough with the text strings for the updates, but the biggest problem is tring to make an object scale according to a value set in the text file.

What I'm doing is this: Loading the text file with the loadvariables command, (which has worked for the text update part) and also loading a variable for a progress bar(with the same text file), which is supposed to show how far along I am in a project. But when I tell the object to scale according to the value loaded by the text file, nothing happens. I thought this might be because of the value being a string instead of a numeric value, but even when I use the NUMBER funciont to transform a string into a numeric value, it still doesn't work. If somebody could tell me what I'm doing wrong with my script, or post an example, I'd be very grateful.

Controlling ScaleMode To Scale/noscale On Different Object...
I don't know where to begin...
Basically, I'm interested in figuring out how to do something like this website.

As you can see the navigation doesn't scale, but the image size adjust accordingly to the size of your browser.

So, I want to know...
1. How I need to prepare the images so that I can avoid pixelation
2. How to set the image to scale, but not the navigation.

Does anyone know any good tutorials...?
I found this tutorial, and it gives me some idea... but not quite the same.

Zoom Button To Scale Display Object
I am attempting to scale a current instance on the stage named siteMap_mc.
The class below is attached to a "zoom icon" thru the library palette



package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.display.Sprite;

public class ZoomIn extends MovieClip {

public function ZoomIn() {
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(event:MouseEvent):void {
siteMap_mc.scaleX *= 1.5;
siteMap_mc.scaleY *= 1.5;
}
}
}



Error: 1120: Access of undefined property siteMap_mc.

I get the error above. My guess is that I do not have a correct "import" statement above.

Another question is how do you now what "import" statements are needed?


My current resources for learning Actionscript are
Essential Actionscript 3.0
Actionscript 3.0 Cookbook"
Lynda.com

Please offer any guidance for more reference material for learning Actionscript.

Thanks in Advance,

Robert Good.

Properly Scale A Bitmap Filled Object?
Basically, I created a rectangle (through as) and assigned a bitmap fill to it. I want to be able to stretch the rectangle without stretching the fill pattern.

Is that possible?

Would I Scale An Object In Relation To The Length Of A Loaded Movie?
I know this should be straight forward but I'm at a loss as to which command to use.

I am loading video.swf into load_mc.

Once the video begins playing I want a (percent played) bar to begin growing.

If the video is 30 seconds long at 30 fps -- the bar would reach 100% of its size when the loaded video hits frame 900 (the end of video.swf).

Any help is greatly appreciated!
Thanks. Pete

Create Object To Scale Based On Users Input
I'm trying to create a virtual classroom in Flash MX.  People will be able to drag and drop lab items into the room to create a classroom.  I want to have 2 form fields for Width and Length of the room in feet.  (1 square foot will be 9x9 pixels.)  When visitors enter their room in width in feet and length in feet, I want the flash movie to show a rectangle to scale.

You can view a rough mockup diagram at this URL: http://www.marcellas-reynolds.com/ss.jpg

Can anyone help with this?  I have had no success looking for help from other resources.

Thanks in advance.

Draggable Elastic MC, Isnt That Elastic
i have an MC (hand) that ive made to be draggable. once the hand is released it should return to its original position....but of course, it doesnt.
the code is a slight variation of some i found a while back and have kept in a folder.

first frame on code layer in main timeline

ActionScript Code:
hand.elasticPos = function(targetX, targetY, accel, convert) {    tellTarget (this) {        xPos = xPos * accel + (targetX - _x) * convert;        yPos = ypos * accel + (targetY - _y) * convert;        _x += xPos;        _y += yPos;    }};


on the 'hand' MC

ActionScript Code:
onClipEvent (load) {    x = _root.hand._x;    y = _root.hand._y;}onClipEvent (enterFrame) {    if (!pressed) {        elasticPos(x, y, .9, .5);        // elasticPos( targetX, targetY, accel, convert);    }}


and finally inside the hand MC is a button for draggable reasons, on which is..

ActionScript Code:
on (press) {    //ignore this stuff...        _root.LEN.gotoAndStop("LEP");    _root.REN.gotoAndStop("REP");    _root.LEB.gotoAndStop("LEBP");    _root.MN.gotoAndStop("MP");        // end of ignore    this.startDrag();    pressed = true;}on (release, releaseOutside) {    this.stopDrag();        //ignore this stuff...    _root.LEN.gotoAndStop("LEN");    _root.REN.gotoAndStop("REN");    _root.LEB.gotoAndPlay("LEBN");    _root.MN.gotoAndStop("MN");       //end    pressed = false;    }



yeh. it doesnt work.
any help would be fantastic
its probably something blindinly obvious but ive been messing with actionscript all day and its all starting to blur...

ive included the original file

How To Scale In Actionscript
hello

i'm trying to make a movie with a MC that starts to scale at a certain point in teh timeline using actionscript. it's driving me madddddd.

thanx
grafx

Scale Actionscript Or More?
Hey guys!!!
I just got through a nice effect at http://huylamphotography.com/ at FACES(ringlite) section where 9 photos are presented and at mouse over the one scale up to the middle squeezing other and fade out,i think is not so complicated im sure that uses actionscript code although im not sure if it forces photo to scale on a button over action or more complicated actionscript determining mouse position having 2 predetermined possitions for each photo, i also noticed a easing on the photos move and everytime ur over a photo it changes soundfx!!! Does anybody have and idea on this actionscript code??
Any help will be appreciated!!

Actionscript To Scale A Swf?
i'm doing a portfolio site and have a intro swf file with animation with buttons

the buttons then open other previous client swf's (in a new layer), but need to be scaled down slightly and positioned to fit into the intro swf's frame

is there some actionscript that will loadmovie in a new layer, scale it to say 90% and have it positioned in a certain x,y co-ordinate?

i'm using this as a starting point but just can't get the scaling working

http://www.kirupa.com/developer/mx/p...transition.htm

thanks in advance

Actionscript To Scale A Swf?
i'm doing a portfolio site and have a intro swf file with animation with buttons

the buttons then open other previous client swf's (in a new layer), but need to be scaled down slightly and positioned to fit into the intro swf's frame

is there some actionscript that will loadmovie in a new layer, scale it to say 90% and have it positioned in a certain x,y co-ordinate?

i'm using this as a starting point but just can't get the scaling working

http://www.kirupa.com/developer/mx/p...transition.htm

thanks in advance

Copyright Đ 2005-08 www.BigResource.com, All rights reserved