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




[FMX]Moving Mc From Xpos To Xpos And Back



I have a mc on the stage. I want the mc to move from one x position to another x position and back to it's previous x position again, after a button is pressed. I have the following function:
Code:
function moveClip (clip, xPos, speed){clip.onEnterFrame = function (){eindX = xPos - this._x;this._x += eindX / speed;if (Math.abs(eindX) < 2){this._x = xPos;delete this.onEnterFrame;} };}
Is this the right function to accomplish what I want and if yes, what should be the action for the button? Thanks in advance,Donald



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-29-2004, 05:19 AM


View Complete Forum Thread with Replies

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

[FMX]Moving Mc From Xpos To Xpos And Back
I have a mc on the stage. I want the mc to move from one x position to another x position and back to it's previous x position again, after a button is pressed.

I have the following function:

Code:
function moveClip (clip, xPos, speed){
clip.onEnterFrame = function (){
eindX = xPos - this._x;
this._x += eindX / speed;
if (Math.abs(eindX) < 2){
this._x = xPos;
delete this.onEnterFrame;
}

};
}
Is this the right function to accomplish what I want and if yes, what should be the action for the button?

Thanks in advance,
Donald

Moving Box Back To Xpos When Reaches Certain X Coord
heya,

i just read your tutorial about making an object move from one side to another by using actionscript. so now i was wondering how to make the box get back into the same place as it started when it reaches a certain point.

can someone please help me with adding the code to this AS i already got:

Code:
onClipEvent(enterFrame) {
speed = 5;
this._x += speed;
}
thank you very much

Moving The Xpos Of The Stage While Zooming In
hi,

what i would like to achieve is the stage moving to a postion were a button has been clicked smoothly while also zooming in on another movieclip in the z depth. I have already done it with movieclips centered but would like to make it more dynamic.

Does anyone have any links that could help me

I need help

Please help

Xpos And Ypos ?
on (release) {
Ypos = -552.5;
}

Can anyone tell me how you figure out the Ypos of something?

AND

What exactly is this action looking for? A MC, an instance, or something else.......

thanks for any help on this

Xpos And Ypos? Please Help :)
Ok. I have a diagonal line which i want to know every point it crosses. I know the start point of the line is:
xPos: 53.6
yPos: -6.5
and the end point of the line is:
xPos: -84.5
yPos: 34.9
How would i calculate every point the line crosses. Please help. Thx for any suggestions given.

Help Trying To Use A Variable To Set Xpos
I am trying to do the following:
1) read some variables (the contents are both text and numbers) from a text file
2) use the text data to fulfill dynamic text fields with the corresponding variables
3) use the numerical data to place some movieclips in their right position

The variables are loaded into an empty movieclip (instance=vars) in the main timeline. Note that everything is in level0.

I’ve placed the variable for a position (maildash1x) in the first line of the txt file. Some text variables defined later than this one are used properly as text fields, but not the one containig a number. That means, in my opinion, that (maildash1x) should have been read by flash. Furthermore I’ve used the trace command to check just before trying to assign a position with that value, and works...

trace ("maildash1x is "+_root.vars.maildash1x);

I think the problem is when I try to set its position using the variable.

setProperty (_root.subopvisto add ".maildash1", _x, _root.vars.maildash1x);

_root.vars is where I placed the variables. The path to set the property is all right as I checked with alpha and visibility, this does work but not when I try to assign the _x position. Do you know why this isn’t working ??
I’ve also tried to use eval and Number, but they return either no value or a NaN. I can’t figure out why it traces the value of the variable properly (42) but doesn’t use it afterwards...

This is driving me nuts, hope you can help...

Ta.

Xpos Limit
I was wondering whether you might be able to help me out with one more thing. I wanted to make a button that controlled the xposition of a target. However, how can i set a limit to the distance that the target can move. For example, I dont want it to move past say 500px. Thanks again.

Xpos Problem
I have a movie clip on the main timeline with the following script.

onClipEvent (enterFrame) {
Xsquare = _root.menu._x;
Xdiff = Xpos-Xsquare;
Xmove = Xdiff/10;
_root.menu._x = Xsquare+Xmove;
updateAfterEvent(enterFrame);
}

within that movieclip there is a button that is set with the following script

on (release) {
tellTarget ("root.circlemc") {
}
when I test the movie and press on the button it gives the following output message:
Target not found: Target="root.circlemc" Base="_level0.menu"

Could someone help me out. I'm new to Flash and I'm trying to put my portfolio into a flash presenetation.

Thanks

Play On Xpos?
Is there a way to have a movieclip start playing when another clip on the stage reaches a certain xpos or ypos. I'm using the easing code and I want a clip with a sound effect and animation to start playing when The other clip reaches a certain xpos after a button press.

Any help is appreciated!!

Oops, Xpos, Y Pos
Sorry, sent that other question off by accident.
Man, looked all over the place for code help for this, but couldn't find it. I have a snippet of code I use to change pos, scale, opacity, etc...

This works great when I change frames, but what if I want to control properties of a MC without changing frames? Is there a simliar tween motion snip of code anyone knows that I can put ON the button to control the MC of choice?

To change properties, I have been using this code:

//code placed on MC
onClipEvent (load) {
targ = 83;
}
onClipEvent (enterFrame) {
_y -= (_y-targ)/3;
}

//code placed on frame
mc.targ = 100;

Now, what I want to do is to move my MC to another y pos with the tween used in this code, anyone help me out?

Does this make sense?

MC On XPos Fire New MCs
trying to write the most concise code here, not sure of the best way to do it...i have a bunch of circle MCs that move in relationship to the cursor...no prob...what i need to do is fire an action, making a new unique MC appear when each circle falls into a specified xPos range...trying not to have an if() else if else if else if etc... should i push all the circle MC instace names to an array and talk to them from there?..thoughts...?

Action When MC Xpos==? ?
Im trying to perform an actions when a movieclips position is equal to a certain coordinate - but i cant seem to work out what the code sould be

also - would I have to continuesley loop this code to keep checking the position somehow? would this slow down things at all?

thanks alot for your help on this

Xpos GotoAndPlay
I have looked around these forums trying to find a solution to my current problem with no success. When my MC2 reaches (xpos = -400) I would like to load a new MovieClip into a placeholder titled targetMC on my main timeline .Or have it gotoAndPlay a specified frame on the maintimeline to I currently Have a movieclip titled MC1

MC1 has the following AS on it:

ActionScript Code:
on (release) {
    _root.MC2.Xpos = 27.5;
    _root.MC2.Xpos = -400;
}

MC2 has the following AS on it:

ActionScript Code:
onClipEvent (enterFrame) {
                        Xsquare = _root.MC2._x;
                        Xdiff = Xpos-Xsquare;
                        Xmove = Xdiff/20;
                        _root.MC2._x = Xsquare+Xmove;
            speed = 2;
}

Thanks for the help in advance

Help Trying To Use A Variable To Set Xpos
I am trying to do the following:
1) read some variables (the contents are both text and numbers) from a text file
2) use the text data to fulfill dynamic text fields with the corresponding variables
3) use the numerical data to place some movieclips in their right position

The variables are loaded into an empty movieclip (instance=vars) in the main timeline. Note that everything is in level0.

I’ve placed the variable for a position (maildash1x) in the first line of the txt file. Some text variables defined later than this one are used properly as text fields, but not the one containig a number. That means, in my opinion, that (maildash1x) should have been read by flash. Furthermore I’ve used the trace command to check just before trying to assign a position with that value, and works...

trace ("maildash1x is "+_root.vars.maildash1x);

I think the problem is when I try to set its position using the variable.

setProperty (_root.subopvisto add ".maildash1", _x, _root.vars.maildash1x);

_root.vars is where I placed the variables. The path to set the property is all right as I checked with alpha and visibility, this does work but not when I try to assign the _x position. Do you know why this isn’t working ??
I’ve also tried to use eval and Number, but they return either no value or a NaN. I can’t figure out why it traces the value of the variable properly (42) but doesn’t use it afterwards...

This is driving me nuts, hope you can help...

Ta.

XPos YPos?
http://www.twinphotographie.com/
I'd also like to learn how to make the square function like this. Any good tutorials out there on this?

Xpos And Ypos Coordinates... Help.
how do I find the xpos and ypos, so that I can have a movieclip ease into place... Im confused on how everyone goes about finding the positions... jus havent touched flash in a few years.

help. thanks.

[F8] Function Getting XPos PROBLEM
I am just learning to actionscript and I am way over my head... any help at all would be greatly appreciated.

Basically, what I am attempting to do is to create a buffer space between my MCs and a mcRollOver so that as one MC changes it's yPos the other MC's change their's dynamically.

I sort of have it working but it takes 5 clicks to get all the buttons to their proper yPos instead of 1.

I have included my working file if you want to take a crack at it.

Like I said, any help or suggestions would be greatly appreciated!

All my code in the movie is on one key frame which I have included below:

code:
var mcNav1start = mcNav1._y;
var mcNav2start = mcNav2._y;
var mcNav3start = mcNav3._y;
var mcNav4start = mcNav4._y;

var mcRollOver0height = 24;
var mcRollOver1height = 200;
var mcRollOver2height = 150;
var mcRollOver3height = 220;
var mcRollOver4height = 324;

mcRollOver1._yscale = 24;

//****************************** mcNAV CONTROLLS ****************************


mcNav1.onRelease = function():Void {
currentNav = 1;
mcTween(mcRollOver1, 0, 0, 1, mcNav1start - 10, 100, mcRollOver1height, 100, 0);
mcTween(mcNav2, 0, 0, 1, mcRollOver1._y+mcRollOver1height+30, 100, 100, 100, 0);
mcTween(mcNav3, 0, 0, 1, mcNav2._y+30, 100, 100, 100, 0);
mcTween(mcNav4, 0, 0, 1, mcNav3._y+30, 100, 100, 100, 0);
};
mcNav1.onRollOver = function():Void {
if (currentNav != 1) {
mcTween(mcRollOver1, 0, 0, 1, mcNav1._y, 100, mcRollOver0height, 100, 0);
} else {
mcTween(mcRollOver1, 0, 0, 1, mcNav1._y-10, 100, mcRollOver1height, 100, 0);
}
};
mcNav2.onRollOver = function():Void {
if (currentNav != 2) {
mcTween(mcRollOver1, 0, 0, 1, mcNav2._y, 100, mcRollOver0height, 100, 0);
}
};
mcNav3.onRollOver = function():Void {
if (currentNav != 3) {
mcTween(mcRollOver1, 0, 0, 1, mcNav3._y, 100, mcRollOver0height, 100, 0);
}
};
mcNav4.onRollOver = function():Void {
if (currentNav != 4) {
mcTween(mcRollOver1, 0, 0, 1, mcNav4._y, 100, mcRollOver0height, 100, 0);
}
};


//****************************** MC MOVEMENT CONTROLLS ****************************


function mcTween(mymc, moveX, myXend, moveY, myYend, myendXScale, myendYScale, myendAlpha, myendRotate) {
var easeType = mx.transitions.easing.Strong.easeOut;
var beginX = mymc._x;
var beginY = mymc._y;
var beginXScale = mymc._xscale;
var beginYScale = mymc._yscale;
var beginAlpha = mymc._alpha;
var beginRotate = mymc._rotation;
var time = 1.0;
var mc = mymc;
var end = myend;
if (moveX) {
ballTween = new mx.transitions.Tween(mc, "_x", easeType, beginX, myXend, time, true);
}
if (moveY) {
ballTween = new mx.transitions.Tween(mc, "_y", easeType, beginY, myYend, time, true);
}
ballTween = new mx.transitions.Tween(mc, "_xscale", easeType, beginXScale, myendXScale, time, true);
ballTween = new mx.transitions.Tween(mc, "_yscale", easeType, beginYScale, myendYScale, time, true);
ballTween = new mx.transitions.Tween(mc, "_alpha", easeType, beginAlpha, myendAlpha, time, true);
ballTween = new mx.transitions.Tween(mc, "_rotation", easeType, beginRotate, myendRotate, time, true);
}

Scaleto() And Xpos/pos Navigation Help
Hello,
Problem:
I have a movieclip that I would like to be able to zoom down with ease to particular points.
I have gone through these two tutorials:
http://imm.sheridanc.on.ca/imm2003/i...l/jm/tutorial/
(follow mouse with ease, and zoom mc) but cannot work out how to put them together.
Basically so that if i clicked on a certain area, the mc would zoom in with ease onto that spot.
Like: http://www.frostdesign.com.au/

I think it involves scaleto() and xpos/ypos.
Cheers!!

Easy Prob, (for A Guru Maybe) If XPos
hi Iv got this if condition problem, here I go
Iv got this button that sets _xdest = 450.
what i am trying to do is set an If move._xPos>= 450 then a function is activated
like this


move.onEnterFrame = function() {
if (_root.move._xPos>= 450) {
out();
}
};

heres the file
thanks in advance for any suggestions.

Easy Prob, (for A Guru Maybe) If XPos
hi Iv got this if condition problem, here I go
Iv got this button that sets _xdest = 450.
what i am trying to do is set an If move._xPos>= 450 then a function is activated
like this


move.onEnterFrame = function() {
if (_root.move._xPos>= 450) {
out();
}
};

heres the file
thanks in advance for any suggestions.

Saving Xpos And Ypos In Actionscript 2 Flash 8
Hi Everyone,

I am making a game where it requires that I save the xpos and the ypos of the player when they save the games. Can you do this as the same with other variables, just store them in variables, or is it more complicated.

Thanks in advance

Attach Movie / Instances Xpos Issues
This is a program I've been working on in my free time. It's a simple game, with not many features so far. you can walk, throw a knife, and bounce off walls for fun...

the problem lies with the enemy i'm working on. when the user touches a 'hitbox', around the enemy, the enemy should start to shoot and/or move towards the hero. Now, the hit detection works fine, but the actual process of attaching a 'bullet' is giving some trouble.

because the enemies are going to be drag and drop, how do I then attach a bullet onto 'enemy' without actually having a presetset xy position? my thought was to create a 'root' variable with enemyxpos, and which ever enemy is being 'hit' would gain control of the these two variables...but it's not working lol. Anytime I try to 'trace' the xpos of the enemy, it's just '0'. The actual bullet itself DOES get attached, but at (0,0) rather than the enemy.

once i get the bullet to attach correctly, I can then make it move towards the hero in a straight line, that's no problem...sort of...

Here's how my code is broken up...pun intended...
================================================== ===

main scene/level1/enemy/(stuff in here)
remember enemy can't use instance names because of drag n' drop method.

in enemy there is

1: instance of hitbox
2: instance of enemyAnimation
where 'enemyanimation' is in the middle of 'hitbox'.

1:


Code:
onClipEvent (load) {
time = 10; //"preloads the enemy' shoot timer
}
onClipEvent (enterFrame) {
if (time<10) {
time += 1; //shoot timer
}
if (this.hitTest(_root.hero)) {
_root.shooting = true;
if (time>=10) {
_root.attachMovie("shot", "shot", i++);
_root["shot"+i]._x = _root.enemyshotx;
//move "shot" onto the "enemy"......not working
_root["shot"+i]._y = _root.enemyshoty;
time = 0;
trace("boom");
}
} else {
_root.shooting = false;
}
}


2:

Code:
onClipEvent(enterFrame){
if (_root.shooting == true){
_root.enemyshotx = this._x;
_root.enemyshoty = this._y;
}
}



Anybody have any suggestions? What I think I need to do is take this from an entirely different aproach, but I honestly can't think of one right now.

How Can I Control Width Of Dynamic Text Field Depending On Xpos?
I have 2 dynamic text fields side by side. textfield2 is set up to always be 10 pixels to the right of textfield1, no matter how wide textfield1 is. I'm trying to make textfield2 resize so that the end of it is always 25 pixels from the right side of the screen. I have textfield2 set to multiline nowrap, but I can't seem to control the width with "textfield2._width=(number or variable).

Can I resize a dynamic multiline nowrap text field with code?

Simple /:xpos Scrolling, However Load External .swf When Scrolling Stops
Hi guys I need some help with a simple horizontal slider. (See attached)
Basically I have a horizontal slider with 3 buttons which make the slider go to a specific position using:

on (release) {
/:xpos = -376;
}

Now what I want to happen is that when the button is pressed I want it to load an external .swf movie (say video.swf onto level 1)

I have tried just adding using:

on (release) {
/:xpos = 0;
loadMovieNum("video.swf", 1);
}


which just loads the movie and then scrolls. However I need it to be the other way around. It scrolls to the location and then loads the movie.

I would really like it to use some type of statement telling it that if xpos = -350 then load .swf onto level 1 and if xpos has not yet reached -350 to do nothing.

However the major principal is to get the scroll and then the load, rather than the other way around.

Cheers
Dom

Moving My Mc Back & Forth
Hi Everyone ,

im stucked. if this moves my mc towards the right and off the screen...

onClipEvent (enterFrame) {
if (_parent.mc._x>=550) {_parent.mc._x=0;
} else {_parent.mc._x+=10
}
}

..and this one the opposite way..

onClipEvent (enterFrame) {
if (_parent.mc._x>=0) {_parent.mc._x=0;
} else {_parent.mc._x-=10
}
}

...how wud i make him move back and forth my screen? what's wrong with my code:

onClipEvent (enterFrame) {
if (_parent.mc._x>=550) {
_parent.mc._x -= 10;
} else {
_parent.mc._x += 10;
}
}

....im stucked.pls? thanks!

Moving An Mc From A > B Then Back
how to do this? Not by pushing a button but moving your mouse on the mc.
The mc starts on x=0 and has to return when it reaches x=200.

it has to happen on mousemove.

onClipEvent (mouseMove) {
if (_x<=200)
_x+=5
}

so far so good. but how to turn it in the opposite way now???

Moving Back And Forth
I have a button on my main page wth the following:

on (rollOver) {
gotoAndStop("GlowButtonOne");
}

The GlowButtonOne movie plays.

If I click the button in the movie:

on (release) {loadMovieNum("AboutUs.swf", 2);
}


it loads another page and the movie clip event for mouse down runs:

onClipEvent (mouseDown) {
gotoAndStop(1)
}

the movie stops but I'm on the timeline inside the movie and I want to be on the timeline where I started on the home page. I'm new to this so I may have done it in a round about way but I just need to get back to my original starting point. I've tried using myParent but that just keeps the movie running. If what I've done isn't too confusing and there is a way to get back to my original page I would greatly appreciate the help. Thanks in advance.

Moving The Playhead Back And Forth
I am trying to rock the playhead backwards and forwards on rollover and rollout of a button targeting a tweened movieclip. The link below (go to chapter 8) is exactly what I want but the fla only works on flash mx and not 5, how can I sort this out?

By the way I have a mac.

Cheers
Lex

http://flashtothecore.praystation.com

Moving Back And Forth In A MC's Timeline
hello,

I'm creating a simple slideshow with "previous" and "next" buttons. There are a number of photos in an MC.

I would like these two buttons (either outside the MC or inside the MC, it doenst matter) to move the timeline of the MC in intervals of one frame, backwards or forwards.

I appreaciate the help

Moving Background Back Anf Forth
Hi guys,

I'm creating a flash game where i need the background image to move back and forth.

Part of the image needs to constantly stay in view thus the image is twice as wide as the movie size.

The little bit of script ive managed so far moves it right and back again but then just gets stuck over on the left.

Anyone got any ideas how i can do this?

Any help would be much appreciated.







Attach Code

onClipEvent(load){
mydirection=1

}

onClipEvent(enterFrame){
this._x+=mydirection*5
if (this._x>5){
mydirection=-1
}
if (this._x<0) {
mydirection=1
}


}

[FMX] Moving Forward And Back
I would like to let a MovieClip to move from lets say _x 200 to _x 800. When the mc reach the _x 800 it should return to _ 200 and visa versa. I like to do this with AS instead of with motion tween.

Somebody who know a god tutorial?

Thanks in advance

[FMX] Moving Forward And Back
I would like to let a MovieClip to move from lets say _x 200 to _x 800. When the mc reach the _x 800 it should return to _ 200 and visa versa. I like to do this with AS instead of with motion tween.

Somebody who know a god tutorial?

Thanks in advance

Moving An Object Back In Space
Almost finished. A couple bugs and my game will be ready for testing. My problem is I have a ship that will shoot bullets just in front of itself. Now, the bullets will bounce off of the barriers if they have a chance to, but if the ship fires the bullet too close to the barrier, it goes INSIDE the barrier and does nothing good for anybody. OK. Now how would I move the bullet back towards the ship till it isn't hitting the barrier? (even if it has to hit the ship by moving back).
This is my script to shoot the bullets:

function shipFire () {
if (bulletShot<3) {
// create bullet
level++;
bulletShot++;
attachMovie("bullet", "bullet"+level, level);
// set bullet location and direction
clip = _root["bullet"+level];
clip._x = _root.ship._x+(50.0*Math.cos(2.0*Math.PI*(ship._ro tation)/360.0));
clip._y = _root.ship._y+(50.0*Math.sin(2.0*Math.PI*(ship._ro tation)/360.0));
clip.dx = 10.0*Math.cos(2.0*Math.PI*(ship._rotation)/360.0);
clip.dy = 10.0*Math.sin(2.0*Math.PI*(ship._rotation)/360.0);
// add to bullets array
bullets.push(clip);
}
}

So my guess is something like this (this didn't work)

function moveBack()
for (i=1; i<30; i++) {
for (j=1; j<30; j++) {
if (_root["bullet"+i].hitTest(_root["barrier"+j]))
_root["bullet"+i]._x = 10 - (_root.ship._x+(50.0*Math.cos(2.0*Math.PI*(ship._r otation)/360.0)));
_root["bullet"+i]._y = 10 - (_root.ship._y+(50.0*Math.sin(2.0*Math.PI*(ship._r otation)/360.0)));

Any ideas? Thanks

Andy

Moving From Code To Frame And Back
What I want to create is a piece of code that at a certain point, goes to a different scene, then returns to that part of the code where it left off. Heres an example based on when im trying to write.
if (level == 2){
enemiesLeft = 12;
bossNow = true;
gotoAndPlay("shySpy", 1);
}
Is there an easy way to do this? Im currently planning on replicating the code for the different levels (if that would work) as a possible alternative, but coding it like this would be easier if its possible.
Thanks for your help peoples

Moving Movingclips And Then Playing Them All Back Together
Does anyone have any sample code or pseudo code to share regarding how i can possibly be able to move 1 or more (say upto 5) movieclips one at a time, record their motion, and then replay them all together?
I can record each movieclips motion into an array given by the movieclip name, but i have no clue how to play them all together.
Ive been cracking my head on this for months, and have got no where. Any help would be appreciated.
Thanks

Moving Back To Prev Frames
Hi, I'm using gotoAndStop("frame_label") to go back to the start of my application. It works fine (with or without using Scenes although this thread adviced me not to: http://www.actionscript.org/forums/s...d.php3?t=76267 ).

My problem is that all movieclips from my previous scene/frame stay and are mixed with those of the frame I'm approaching. I want to go to frame one and only see what was seen when I started the movie.

This should be standard, or? Now it seems I have to clear everything by hand.. Or actually even that can't be done because removeMovieClip() only works on dynamically created mc:s.

Any thoughts on this?

Moving The Moviclip Back Using A Timer
Hi
I am learning to do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.

and the clipdrag movieclip is droped at say _x=200, _y=300.
Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.



please can anyone help
thanks


Flash 5: Moving Back And Forward With Buttons
Hello there!

i am just learning actionscript and i have this problem: i want to present a portfolio with a number of jpgs. i have a button to click if you want to go on looking at the next picture and i have a button if you decide to look at the ones you have already seen, i.e. go backwards. but since i want to fade the pictures in and out, moving backwards poses a problem to me. how can i solve this?

thanx for the help!
*t_girl

Moving In A Circle: New Variable Back Into Function.
So, I have this script working when it's not in a function, but really what I want is to reuse the code for multiple movieClips. I am posting my actionscript, the bit that is commented out works and makes the circle (mcGreenCircle) move in a circle, but then when I put it into a function, it keeps feeding it the beginning variables. I think that what I need to do is pass some outputs from the function, back into the function.


Code:
function moveCircle(radius:Number, frameAngle:Number, target:MovieClip, regX:Number, regY:Number) {
if (totalAngle == null) {
var totalAngle:Number = 0;
}
totalAngle += frameAngle;
trace("total angle:"+totalAngle);
var totalRadians:Number = totalAngle*(Math.PI/180);
trace("total rad:"+totalRadians);
var newXCoord:Number = radius*(Math.sin(totalRadians));
trace("new x:"+newXCoord);
var newYCoord:Number = radius*(Math.cos(totalRadians));
trace("new y:"+newYCoord);
target._x = (newXCoord+regX);
target._y = (newYCoord+regY);

}
moveCircle(150, 7.5, mcGreenCircle, 200, 150);



/*
var radius:Number = 150;
var frameAngle:Number = 7.5;
var regX:Number = 200;
var regY:Number = 150;
if(totalAngle == null){
var totalAngle:Number = 0;
}
totalAngle += frameAngle;
trace("total angle:"+totalAngle);
var totalRadians:Number = totalAngle*(Math.PI/180);
trace("total rad:"+totalRadians);
var newXCoord:Number = radius*(Math.sin(totalRadians));
trace("new x:"+newXCoord);
var newYCoord:Number = radius*(Math.cos(totalRadians));
trace("new y:"+newYCoord);
mcGreenCircle._x = (newXCoord + regX);
mcGreenCircle._y = (newYCoord + regY);
*/

Thanks.
C

Moving Bars Conceal/reveal And Button Back Up?
Hello

Using Flash Prof 8...Couple of major things that I have no idea how to do...if you go to

http://www.enhancedwireless.net/Tech...Mechtest.shtml

and press play on the "ODMA" demo graphic (it's a work in progress not complete), you'll see the vise-like bars closing and shutting - I need for the text to be hidden then revealed as the bars move across the text...how do I do this? I'm newish to Flash so as detailed (code whatever) as you could be, would be appreciated greatly. Thanks in advance for your time.

And if you let the whole clip play to end (under :50) it jumps back to the beginning, which I want, but you'll notice that the "play_mc" button pops up then immediately disappears...I need it to stay on as at the beginning.

On the last frame (actions layer) of my main mc called keyMech_mc is this code:

gotoAndStop("Scene 1", 1);
_root.play_mc._alpha = 100;

My play button which is actually a movie clip, play_mc, has various alpha code for it on my main timeline on actions layer first frame as follows:

_root.KeyMech_mc.stop();

play_mc.onRollOver = function(){
this.gotoAndStop("over");
}
play_mc.onRollOut = function(){
this.gotoAndStop("out");
}
play_mc.onRelease = function(){
this.onEnterFrame = function(){
so = this;
rate = 5; // choose number between 1 and 100

newAlpha = so._alpha - rate; // subtract rate from current visibility
if(newAlpha > 0) { // continue fade
so._alpha = newAlpha; // set newVolume to decrease visibility

}else if(newAlpha == 0){
so._alpha = 0;
}

}
}


(ABOVE CODE WAS KINDLY GIVEN TO ME BY A FLASHKIT VIEWER)

===========

Just wanted you to have all the info possible re: this play_mc so I can get it to stay back up at the end of the movie...

And I'm really stumped as to how to do the revealing bars thing.

Thanks for any help!

KB

Moving A Point And Remaining A Path (line) Back
I want to move a point to a coordinate (_x,_y) and this point must go there slowly and create a path (line ) . After that the point must return and also slowly and the path must disapeare. Can You help me. I am a beginer.
I need to know an instruction used for delayng actions.
Bye.

Drag And Drop - Moviclip Moving Back To Old Position
Hi Guys

I am learning to do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.

and the clipdrag movieclip is droped at say _x=200, _y=300.
Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.

please can anyone help
thanks
orange

Drag And Drop - Moviclip Moving Back To Old Position
Hi Guys

I am learning to do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.

and the clipdrag movieclip is droped at say _x=200, _y=300.
Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.

please can anyone help
thanks
orange

Keeping A Scrolling Movie Clip With Forward And Back Buttons Moving
I have a movie clip that scrolls with forward and back buttons. This is working perfectly but I am looking for some code to keep it consistently scrolling when the buttons are not being used.

Any help would be greatly appreciated. Right now my code looks like this...

moveLeft.onRollOver = function() {
rocket.onEnterFrame = function() {
this._x -= 10;
if (this._x < -3340) {
this._x = -3340;
delete this.onEnterFrame;
}
};
};
moveLeft.onRollOut = function() {
delete rocket.onEnterFrame;
};
moveRight.onRollOver = function() {
rocket.onEnterFrame = function() {
this._x += 10;
if (this._x>80) {
this._x = 80;
delete this.onEnterFrame;
}
};
};
moveRight.onRollOut = function() {
delete rocket.onEnterFrame;
};

Global Sound Reducing Volume - Problem When Moving Back N Forth Between Frames.
Hi,

I have a mute button in my game, it works on the inital frame (titlepage) and the main game page.

However when the user quits back to the title page, odd behavious happens.
To diagnose I traced the volume (as this is how I toggled the sound on/off)

See code below:-


Code:

var globalVolume:Sound = new Sound();
globalVolume.setVolume(50);

//Key Listener to allow sound volume to be 0/50 to mimic a mute button
keyslistener = new Object();
keyslistener.onKeyDown=function(){
if(Key.isDown(83))
{
keypress = "on";
globalVolume.setVolume(50-globalVolume.getVolume());
trace(globalVolume.getVolume());
}
}
Initally the code worked as expected showing the toggle off volumes 0,50,0,50 etc.., until I quit the game and then it would print 0 & 50 on one single keypress.

Can anyone shed some light? It appears as if there are two 'groups' of sounds running.
Confused.com

Thanks
Rob

Play Movie Forward Or Back By Moving The Mouse After A Click - Glen Charles Rowell
Has anyone made a file that I can click and move the mouse to play a movie forwards or backwards when moving along the x-axis? I want to be able to rotate 3D pictures

If not I would like help making this.

Thank you.

Glen Charles Rowell

Can You Use The Back Button In A Browser To Go Back To Go Back In A Flash Movie?
Hi
In html pages it is easy to go back (the back button in the browser) to the last page you were on. But when you have got a flash site in a html page you cannot go back to the last page in the flash site using the 'back' button in the browser. Is there anyway you can change this so that you can use the back button in a browser to go back to the last flash frame?

Moving From Final Movie Back To 1st Movie
Hi folks:

I have a movie that's set up like this:


| movie 1 | movie 2 | movie 3 | movie 4 | movie 5 |

in between the script to move from one movie to another is:

stop();
_root.nextFrame();

How do I get the movie to go from movie 5 back to movie 1. Right now it just stops.

Thanks in advance

Moving Flash 9 Content Back To Flash 7
A webdeveloper has used Flash 9 on my clients website.

I didn't want him to do it because it's only a month old.

We're having all kinds of problems with people no being
able to download or just flat out won't do it.

Developer said it can't be moved back to Flash 7.
I would like to email him the instructions on how to
do it since he has no interest in my clients concerns.

There must be away. Please help

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