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




Move MC Slowly Using SetProperty



Im trying to figure out how to move a movie clip on it's y axis using setProperty, without the move happening all at once. I'd like the clip to move slowly.

Can someone help me out with the actionscript I need?



FlashKit > Flash Help > Flash ActionScript
Posted on: 06-22-2002, 10:01 AM


View Complete Forum Thread with Replies

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

OnMouseOver MovieClip Move Slowly
Hello,

I am trying to create a slideshow and when the user hovers (rolls over) a down arror, the slideshow gradually moves up or down.

I've attached the file, does any one know I can get the slideshow of images to move slowley?

Cheers, Rob

Moving Mc Towards The Move Slowly Towards The Mouse
Hiya newbie here

I just want to know how to move a movieclip towards the mouse slowly.

i have used this code to get the mc to the mouse, but i am stuck on how i make it move slowly towards it.
please help
thanks

onClipEvent(enterFrame){

this._x = _root._xmouse;
this._y = _root._ymouse;
}

Moving Mc Towards The Move Slowly Towards The Mouse
Hiya newbie here

I just want to know how to move a movieclip towards the mouse slowly.

i have used this code to get the mc to the mouse, but i am stuck on how i make it move slowly towards it.
please help
thanks

onClipEvent(enterFrame){

this._x = _root._xmouse;
this._y = _root._ymouse;
}

How To Make The Object Move Back Down Slowly?
ok you know when on a button it may "move up" or somthing and then you get off the button and it pops righ back into place.. how do u make it move slowly and fluently back to the posision.. liek if the is a block and then you but the mouse over it and it moves slowly taller then you take it off of the button and it slowly moves back to the orignal state? what code do i need for this...?

How To Make An Object Move Slowly Then Stop ;_;
Hello,

This is my first time to post here.. and am new to Flash ^_^;;
ummm.. i want to make an object that moves horizentally in a movie clip..but I dont know how to make it move slowly then gradually stop..! I tryed playing around with the ActionScript ..but no luck ;_; plz help..

Thanks Alot..
OniHime

Script For Cartoonified Animation (Move Head Back Slowly)
Hi People,
Iv'e done most of this little animation but i came to a problem. When i move away from the targeted area with the cursor the head just moves quickly back to the default area. BUT what i want it to do is when the cursor is out of the targeted area i need the head to move back to its original space slowly. If this is possible? Any help i would be highly grateful!

As seen in the attachment.

Thanks for all your help!
Carl Taylor

Script For Cartoonified Animation (Move Head Back Slowly)
Hi People,
Iv'e done most of this little animation but i came to a problem. When i move away from the targeted area with the cursor the head just moves quickly back to the default area. BUT what i want it to do is when the cursor is out of the targeted area i need the head to move back to its original space slowly. If this is possible? I'd be highly grateful for any help!

As seen in the attachment.

Thanks for all your help!
Carl Taylor

How To Move An Object Slowly And Smoothly From Location 1 To Location 2?
Hi,

I am new to ActionScript. I wish to use ActionScript to move an object slowly and smoothly from location 1 to location 2.

I learned that I can use the following to move an object to location 2 (x2, y2):

mThisObject.x = x2;
mThisObject.y = y2;

However the object just "swift" from location 1 to location 2, not moving slowly and smoothly from location 1 to location 2.

Could some experts here provide a guideline for me?

Thanks and best regards

Alex

Flash Component Loads Slowly Or Renders Slowly
Hi,

Does anyone have a problem with flash 8 components loading very slowly. I have a mainmovie page that loads other .swf files into a movieclip. The sub movie has got flash 8 components, basically, 4 buttons, 4 datefields, one combo box, one menu bar and one datagrid. When i load the sub movie into the mainmovie, the components flashes for a second and then shows the components. I use a moviecliploader as well to hide the loaded movie and only after it's loaded then show the loaded movie, still the components flash.

Any ideas as i have been trying to solve this for about 5 hours now. Any help much appreciated.
Thanks

Move Object With "setProperty"
I'm trying to do a object goes to a certain point with setProperty.
I want the objecto moves not directly to the point but like motion tween.

Lets say i have object A with 50(_X) and i want that goes to 200(_X)
like a motion tween using setProperty(i think its this command to use... or not ?).

And if its a bar with 10 buttons ? In this case i want to do like the other one but move the bar(object A) acording to the button i choice.

Best Regards

Images Move Left To Right, Fast And Slow On Mouse Move...
I'm looking for a tutorial or example of the effect when you have images all next to each other horizontally and when you roll the mouse oneway they move in the opposite direction and when the mouse is centerd on screen they slow down... Anyone have an example or tutorial of this?

Images Move Left To Right, Fast And Slow On Mouse Move...
I'm looking for a tutorial or example of the effect when you have images all next to each other horizontally and when you roll the mouse oneway they move in the opposite direction and when the mouse is centerd on screen they slow down... Anyone have an example or tutorial of this?

Images Move Left To Right, Fast And Slow On Mouse Move...
I'm looking for a tutorial or example of the effect when you have images all next to each other horizontally and when you roll the mouse oneway they move in the opposite direction and when the mouse is centerd on screen they slow down... Anyone have an example or tutorial of this?

Allowing The User To Move Move An Object (graphic Asset)
I'm working on a Flash presentation that will be an instructional tutorial. I'm teaching users how to navigate a map and I'd like to have them move a ruler or legend to measure distances between two points. Can anyone direct me to a reference source that can help me set this up?

I'm a fairly new Flash user but very eager to learn this technique.

Thanks,

Jerry Marino

Images Move Left To Right, Fast And Slow On Mouse Move...
I'm looking for a tutorial or example of the effect when you have images all next to each other horizontally and when you roll the mouse oneway they move in the opposite direction and when the mouse is centerd on screen they slow down... Anyone have an example or tutorial of this?

Setproperty
i am having loads of trouble with the setproperty function. all i am trying to do is set the x-scale of a graphic to myvar%.

any code or suggestions please!

SetProperty... I Don't Know If Im Doing It Right?
Hello and thank you forum....

here's the dilly. Im trying to get an MC to start off invisible and then when I press a button..... get the MC to become VISIBLE. Sounds simple, which Im sure it is... but It's not working... here's my code

onClipEvent (load) {
setProperty ("MC", _visible, "false");
}
and then for the button

OnPress
setProperty ("MC",_visible, "true");

it doesn't even start off invisible??

HELP

Setproperty, Help
Well, here it goes:

I got two buttons in a "menufolder" folder. They are called "fol1" and "fol2".
Now when you clic on "fol1", "fol2" should move

so i got this actionscript in "fol1"

on (release) {
setProperty ("fol2", _y, "185");
}

when I test, the only things that happens with the button when I click, is the down state... nothing else, no error... Can anyone help me?

I am using flash 5.
[Edited by dandin1 on 03-15-2002 at 06:57 PM]

Setproperty
can any1 help ::

in the first frame i have :
loadMovieNum ("pca.swf", 0);

in the second frame i want to set the position of the movie so i have :
setProperty ("0", _y, "195");

now the second action doesnt seem to do anything and i have tried to follow
the instructions of a tutorial but now my head is about to explode ..
thanks if u can

SetProperty
// setProperty("_root.holder", _width, "85");
// setProperty("_root.holder", _height, "111");
// loadMovie("des6Contents.swf", "_root.holder");

I can''t seem to get these three lines of code to work together. When I comment out the two setProperty line the movie scomes in fine, but as soon I put those two line of code in nothing loads in (or at least I can't see anything).

What do you think?

Thanks
Erik

Setproperty
How does one setproperties for new movies being loaded so they appear in a particular location in the main movie level 0. I do not want to go back and resize all the movies that I am loading. I basically want my home page to stay the same and load new swf files into a specific area on the page. Each buttong will load different swf files back and forth. I know how to load and unload, but can not resize and place them on the main level.

Are movie clips better. If so why and how. I am having trouble with them.

Thanks.

Pkab

SetProperty()
I want to know if you can use the setProperty() function to change the _x(x position) of an object in a different frame on the stage.

Setproperty()
I want to make a button that maks another button move sidways when my mouse goes over it but it does's seen to work. This is the actionscrpt I used:

on (rollOver) {
setProperty("button2", _x, "getProperty(button2, _x)+20");
}

SetProperty
Am I missing something here? Real simple


Code:
loadMovieNum ("music.swf", 1);
setProperty ("_level1", _x, "300");
setProperty ("_level1", _y, "125");


I've even put the setproperty's in the next frame just in case.

Why does the loaded movie "music.swf" not get placed in the said x and y values?

thanks in advance!

SetProperty. Help
Im working on a navigation which in a MC called thumbs (containing thumbs of larger images to be loaded) I have added a clip event to each thumbnail within mc_thumbs that dynamically loads jpgs into _root.photocontainer_top.photocontainer.

heres the code for that:
onClipEvent (mouseDown) {
if ((this.hitTest(_root._xmouse, _root._ymouse, true))) {
_root.nav.thumbs.nav01.gotoAndPlay("true");
loadMovie("http://"target"/photo_01.jpg", "_root.photocontainer_top.photocontainer");
}
}
OK..that works well.

Next, I need to set the _y property of mc_photocontainer_top to adjust for the width of each jpg.
I added a loop in mc_thumbs thats always checking the width of mc_photocontainer(this is the target of which the jpgs are loaded to) and I also want it to use this info to adjust for when a jpg with a different width is loaded in. The reason Im using a looping timeline to do this is that in order for a property to be changed, mc_photocontainer must be populated by the jpg that the property will be taken from. Hope that makes sense.

This is where Im having a problem setting the property:
On the frame thats being looped I put this code...and many variations, but I cant seem to get it to work.

width = "getProperty(_root.photocontainer_top.photocontain er, _width)";
setProperty("_root.photocontainer_top", _y, 360 - "width");

Im sure its a matter of syntax...im really rusty at this stuff and Im always confused about when I should use expressions or not.

TIA!

SetProperty
Hi,

I got a simple question. But not quite sure how to go about it.

I'm using set property scale a movie:
on (release) {
setProperty(_root.skate,_yscale,500);
}

I have the movie clip on the main timeline called "skate". Now I want it to scale with a motion tween;

Any ideas.

regards,
shalin

SetProperty
Hello,

Im new to flash and need help

I have a few movies which act as menu buttons in my .fla

What I want to do is make one movie clip move to a set position when the mouse rolls over another. I have given the desired movie clip an instance name and tried using the setProperty control and changing the _x value without any luck. Does anyone know what I am doing wrong?
Thanks in advance.

SetProperty
hi. i'm familiar with code but new to actionscript. this is probably a stupid question.

the following bit is used across half a dozen instances of a button. i want the 'spark' to fire somewhere near the coords of the mOver (doesn't have to be precise), but this keep returning the same position for EVERY instance - the top left corner of the uppermost button instance. how can i fix it?

tyia


Code:
on (rollOver) {
temp = 1;
while (Number(temp)<=10) {
current = random(1000);
duplicateMovieClip("/spark", "spark" add current, current);
setProperty("/spark" add current, _y, "random(1000)");
setProperty("/spark" add current, _x, "random(1000)");
set("/spark" add current add ":xspeed", Number(random(6)-3)+1);
set("/spark" add current add ":yspeed", random(8)*-1);
set("/spark" add current add ":zspeed", random(10)-5);
set("/spark" add current add ":fade", Number(random(5))+3);
temp = Number(temp)+1;
}
}

SetProperty?
I need a little bit of help with setProperty. I've got a Movieclip, with this code on it:

code:
onClipEvent (enterFrame) {
if (this.hitTest(_root.chara._x_root.chara._y, true)) {
_root.instancename = _root.baackt.console1;
_root.MakeLight();
}
}


the thing that _root.instancename is being set to is the instancename of the movieclip. Then, for my function MakeLight, I've got:

code:
function MakeLight() {
setProperty(instancename, _alpha, 25);
}


does anyone know how I can actually get the function to set the property of the instancename mentioned in the variable? I've been trying all the tricks I know, but haven't figured out a way to yet.

Thanks,
Spidy

SetProperty
i am trying to make the mc gun hide unless you have the space bar pressed down. on thefirst frame i have it hidden and then the following to make it show. but its not working. does setProperty not work with mc's?

[code]
onClipEvent (enterFrame) {
if (Key.isDown (Key.SPACE)) {
setProperty("gun", _visible, "1");
}
}

SetProperty
Shouldn't these two lines do the same thing?

code: _root.mc._alpha = 0;

setProperty("_root.mc", _alpha, "0");


I have a button inside of a mc named intro, which is on the _root. On that button I have:

code: on(release){
_root.gotoAndPlay("someFrame");
_root.paused._alpha = 0;
}

And on the _root I have a mc named paused.

When I press the button, the _root does gotoAndPlay, but paused does not change it's _alpha to 0.

However if I use setProperty it does work. Where is my confusion in this?

Thanks.

_t

Is This A BUG? SetProperty And Var Name
Hello

I've been trying to do something that detects the first object in a row of MC's and "swaps" it with another the user clicks (if he selects the 1st, it will stop).

What happens is that, even tracing every var and knowing they have the correct names, I can't seem to make even a simple SetProperty action on the "HITTED" MC (the one over the hitarea).

I've tryed using arrays to define position and setting the MC's into their _x according to predefined values, but the SetProperty always fails.

Can someone please help. Am I doing something wrong? Is this a bug? I've upload the swapingmanual.fla.

Thanks in advance.

SetProperty Help
I am trying to make it so that a movieclip grows a little after a certain amount of time, but i cant qutie get it to work:

if(_root.timer == 50){
setProperty(enemy, _width. 25);
}


It would be better if i could get it to increase size instead of having to repeat the code. Any help is greatly appreciated.

SetProperty Help
I am trying to make it so that a movieclip grows a little after a certain amount of time, but i cant qutie get it to work:

if(_root.timer == 50){
setProperty(enemy, _width. 25);
}


It would be better if i could get it to increase size instead of having to repeat the code. Any help is greatly appreciated.

Setproperty
I am trying to load a .swf into another swf. The problem is the movie clip that is being loaded is larger than the space that I want it to take up in the main swf. How do I load it where I want it and have it sized the way I want it? Please help. This is driving me crazy.

Setproperty
hi
can anybody explain me the setPropety funtion

What Should I Use Instead Of SetProperty?
I am editing a scrollbar I made years ago and in the code are these lines:

setProperty("_root." add thetarget, _y, originaly);
setProperty("_parent." add thetarget, _y, originaly-scrollRatio*hiddenHeight);

When I wrote this it worked fine because I was using AS1, but now I am using AS2 and these lines do not work.

Can someone help me out, what can I swap this for?

Cheers

Get/setProperty
im still trying to get a movie clip to 'hover' over another. i have succeeded in getting this to happen, however getting the registration points to match has been a problem. even using codes supplied by forums members, has unfortunately not workedm but i have learned A LOT, many thanks!

i have figured so far that i need to get the position of myCar movieclip in order to set that property to Light1 movieclip that is to 'hover' above myCar. however there is another movieclip Light2 that resides inside Light1. Light2 is aligned Left <100px from the centerStage of Light1.

i don't know the exact code to get the registration point of Light2 mc to be the coordinates that are used for the Light1 mc to 'hover' above the myCar mc.


Code:
onEnterFrame=function(){
this.Light1.Light2._x=this.myCar._x
this.Light1.Light2._y=this.myCar._y
}
i KNOW i'm missing something - i just dont know what. i dont know how to use the get/setProperty and the myVar.object. i experimented with those yesterday and while it looked easy to understand on the liveDocs, applying the principles werent working -

im a programmer - stuck in an artist's brain - it sux

thanks

SetProperty
I have a MC that I am duplicating on stage. The code I have for the setProperty is
Code:
setProperty("sparks", _x, random(500));
setProperty("sparks", _y, random(200));
Of course the duplicates are going from 0-500 on the _x, and 0-200 on the _y. How would I make it so the duplicated mc's only appear between 400 and 500 on the _x, and 100 and 200 on the _y? I tried several different ways but they don't seem to work.
Any help? Thanks

SetProperty
Hi,

Im struggling to figure this problem out. I have four movie clips on the stage and I want to have a button that when clicked the setProperty function is called and the visibility of 3 clips is set to false and one is set to visible.

Can someone please help me with this Im killing my brain why i cant figure this out!

I basically just want my button to change the content which is the 4 movie clips.

Cheers for any help

SetProperty
Hey everyone, flash newbie here. Just want to ask a simple question about setProperty.

Why do we use it anyway? For example, wouldn't "target._xscale = 100" be alot easier then setProperty("target", _xscale, 100)?

Thanks in advance.

SetProperty
hai guys
i m new to flash scripting, can anybody tellme abt "setProperty" and abt all of its property like ,,"_x,_y,_xmouse,_ymouse, etc"

any reply will be highly apprecialbe
with regards
maggi

Setproperty
hello! Am new here in ultrashock and I read some of the tutorials but one thing stumped me...

this code:





on (keyPress "<Left>")
{
var a;
while (a!=0)
{
a=getProperty(this,_x);
a--;
setProperty(this,_x,a);
}
}

Am using MX 2004 and the 'this' pertains to an animated GIF. I had in mind that when I press the left button, the gif would move to the left. But unfortunately, the GIF just jumps to x coordinate 0. Am I missing anything here?

Thanks for the help guys!

Help Plz Cant Use Setproperty On _X :(
Hi folks,

Been trying to get a little flash script runing that saves co-ordinates into a file (via PHP) then reads it back and places objects on the screen where they were last left.

It works on the _Y plane but the _X doesnt want to work.

Can a guru have a qukck look thanks.

Regards,

Rikki

Move Movie Clips On Mouse Move (opposite)
Hi.

Does anybody have idea how this thing work (the cirlcles moves)?

http://www.templatemonster.com/flash...tes/15650.html

As well as the button gets closer to mouse when near the buttons.

I cant seem to find here .


Thanks very much.

SetProperty Question
hey people my first post on FK -=)

any how am now starting and trying some basic action.
i got a MC moving from the left of the stage to the right,
but what if i wanted it to start from the middle of the stage and go to the right -=) instead of going left.
my stage is w400 h250 thank you

My Code
__________________________________

onClipEvent (enterFrame) {
b = 10+b;
setProperty ("_root.ball", _x, b);
}

SetProperty Not Working...
I'm trying to make a "memory" game where a card flips over when you click on it, and if it's the second card, it flips over, pauses, then flips back over (if they don't match). The setProperty function, however, waits until *after* all the functions in the on(release) function are executed, meaning the card never flips over. Here's the code, any help would be greatly appreciated:

function clicked(num) {
thenum = num;
num = picsArray[num] + 1;
setProperty ("_root.square" + num, _visible, false);
setProperty ("_root.pic" + num, _visible, true);
checkPaired(num);
}

function checkPaired(num) {
num = picsArray[num] + 1;
if ( lastpicked == null )
{
lastpicked = num;
}
else {
for ( i = 0; i < 10000; i++ ) {
if( null ) {
getTimer();
}
}
clearLast(num);
}
}

function clearLast(num) {
if ( lastpicked - 10 == num || lastpicked + 10 == num ){
setProperty ("_root.pic" + num, _visible, false);
setProperty ("_root.pic" + lastpicked, _visible, false);
}
else {
setProperty ("_root.pic" + num, _visible, false);
setProperty ("_root.square" + num, _visible, true);
setProperty ("_root.pic" + lastpicked, _visible, false);
setProperty ("_root.square" + lastpicked, _visible, true);
}

lastpicked = null;
}

SetProperty For Buttons?
Is it impossible to use setProperty for buttons?

Can I SetProperty Of A Submovie?
Can I setProperty of a submovie?
I have a movie (B) in a movie (A).
I put the parent movie (A) onto the main timeline.
Is it possible for me to change an attribute of the submovie by using setProperty?

i.e. setProperty (MovieA.MovieB, _visible, "0");

I've tried experimenting... but each time I make a call... the parent movie gets set the attribute I'm trying to change.

Or, should I be using different syntax?
[Like square brackets or something?]

I'd apprecite if someone could confirm or deny if the above is possible or not.

Thanks.


Jam

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