From Motion Tween 2 Actionscript 3
hi helo all how can i make a motion tweened animation work after i have copied the generated AS3 code and applied it to the neccessery symbol i hav been trying to make it wok but noting changes even after i hav tweaked the AS3 code a bit u kno wha i mean please am not very fund of AS3 but hav to be now cause the niw feature in flash CS3 is intresting tu mii and i wana see it in ACTION please guide mua tanks much much k's inc
KirupaForum > Flash > ActionScript 3.0
Posted on: 08-04-2008, 01:00 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Is It Possible? Motion Guide + Motion Tween + Actionscript Api Drawing
Hi
Im looking for some help I've done a lot of research and spent hours trying to find a way to do this so any input is appreciated.
I have drawn a shape in actionscript
_root.createEmptyMovieClip("myMoon",6);
with (myMoon){
beginFill(0x999999, 100);
drawCircle(50,120,30);
endFill();
}
new Tween(myMoon, "_x", Elastic.easeOut, 0, 300, 3, true);
Basically I have a tween on it that works fine but what I need to do is motion tween along a motion guide.
Of course I know how to achieve this through the normal way of drawing a circle through the tools box but I have to figure a way out to do this to the shape drawn in action script via the drawing api. How can I do this?
I presume I have to someway make this shape appear in my library as a symbol possibly? Hope someone has a soloution thanks a lot
My First Try At Actionscript Motion Instead Of Tween
this is a nav i made for my portfolio site... its not done, its just the navagation, i was tryin out some actionscript motion instead of tweening, and im happy with the results, it messes up of you click on one too much, itl send it off the screen if you click it at the right time, i can fix this if i want, its just more scripting, but if you like this please tell me, and if you dont tell me, i need some feed back, if you wanna know how to do this, ill help you out
http://www.sopon.net/~brandon/port/
thanks
[Edited by brandonvb on 07-02-2001 at 12:55 AM]
Actionscript Vs Motion Tween?
I'm currently working on a flash site where I need to create a very long, slow animation, consisting of a circle that goes round an eliptical path over about 1600 frames.
I've tried using a motion tween, but when the SWF is exported it's already around 80K which is totally unacceptable. If I continue at this rate the finished movie will be massive. I guess it's the number of frames in the tween that's causing the problem?
Can anyone tell me how I might achieve the same motion effect using a bit of actionscript?
Thanks.
How Do You Do A Motion Tween In Actionscript?
hi..
I need to make a movie clip slide from one position to another or something similar..but in action script..
If I use a for loop or something it will just happen instantly and the motion will be too fast..
How can it be done?
Thanks
Actionscript Instead Of Motion Tween?
it was suggested to me that i should use actionscripting rather than motion tweening in my flash site, for more precise control. can anyone tell me if there are any tutorials anywhere that deal with this subject.
Actionscript Motion Tween
How do i make an action script move a symbol over a set number of frames? like a motion tween, but actionscript style
Motion Tween Through ActionScript ?
hi,
can we make motion tween through Action Script?
I mean if I make on movie and convert it to another movie I have created, Can I do it throught ActionScript ????
How Do I Do A Motion Tween By Actionscript?
I know how to make an object move with this action below.
Now the thing i can not figure out is how to make the object stop.
with the code below it keeps on going.
Can anyone help me, by telling me how i can make it stop at a certain point in my movie before it goes off the movie?
onClipEvent (enterFrame) {
this._x+=10;
}
How Do I Do A Motion Tween By Actionscript?
I know how to make an object move with this action below.
Now the thing i can not figure out is how to make the object stop.
with the code below it keeps on going.
Can anyone help me, by telling me how i can make it stop at a certain point in my movie before it goes off the movie?
onClipEvent (enterFrame) {
this._x+=10;
}
Actionscript A Motion-tween
_x and _y can move a symbol to specified positions on the canvas.
..but is it possible to (using actionscript only) make my symbol motion tween accross from its current place to position _x A and _y B?
any help much appreciated thanks
Motion Tween In ActionScript
How do you motion tween in ActionScript 2.0? What is the code?
I have typed in "tweening" in the "search" and although I came up with many results none made sense or the answer just wasn't there. Although I'm using Flash 7, I am just curious what the AS 3.0 would be also, despite I may not use AS 3.0 in a long while yet, I'm still learning AS 2.0.
[F8] Motion Tween Vs Actionscript
does anyone know how to make an animation where word by word they show up one after another....what I have to do is animate a paragraph, and my boss wants one word to come in after another. Its easily done by motion tweening...but when you have 50+ words in each paragraph...well...UGH. i tried one slide and it takes about an hour. does anyone know of any actionscript that would solve this problem of mine? I need something faster....
Motion Tween With Actionscript
Hi,
I was wondering if you could help me. I know how to do your basic motion tween where you set up a point at say frame 10. Then set the end point at say Frame 20 and have it move along the path you specify in between.
BUT
Is it possible to create a motion path but have actionscript determine whether it moves along the path or not (not based on which frame its on).
So for instance I have a worm I want to move across the screen in a certain way. Depending on what key the user presses determines if it moves along the path I have specified or back along the path it has just been.
Hope Ive explained it correctly.
Can anyone help?
Cheers, Dave
Motion Tween W/ Actionscript
I am working on a site where I have a box with a header title. the title needs to change based upon what button was pressed in the menu. Currently i have some script for each button that looks like this:
on (release) {
_root.box1.titlemovie.boxtitle._y = 0;
_root.box2.titlemovie.boxtitle._y = 0;
_root.box3.titlemovie.boxtitle._y = 0;
}
Each button has a different y value though, because the movie is a text box that had the titles typed out in list order. There is a mask that only reveals the correct title. So I want the y position of the text box movie (boxtitle) to change when I press on the button so the corresponding title is revealed by the mask. Currently, as you may be able to tell from the primitive scripting, the box will jump from one y value to another. I want it to tween from one value to another so that the change looks smoother. Someone else asked sort of the same question, but with aplha changes and someone replied with this:
function alphaTween() {
easeType = mx.transitions.easing.None.easeNone;
var time = 1;
startAlphaTween = new mx.transitions.Tween(mc, "_alpha", easeType, 0, 100, time, true);
}Where:
easeType descibes a motion tween (mx.transitions.easing.None.easeNone here as you only want an alpha tween)
time = duration of the tween (seconds or frames)
mc = movie instance name
0 = starting alpha value
100 = end alpha value
true = boolean value (true = use seconds, false = use frames)
Does someone have another function but for motiontweens?
Conflict: Actionscript/Motion Tween
The following actionscript works fine as long as it is a separate movie. However, I want it to be a part of a "bigger" movie. (A large picture (button) is fading in and out on the scene by using Motion Tween on the Timeline. I have put the instances stop_btn, play_btn and pause_btn beneath the picture on the scene.) When I play the movie everyting looks right from the beginning: The movie i silent, but the picture is fading in and out.
Now the problem: When I push the Play-button the music starts as planned, but I canīt pause the music (Stop-button works). And if a push the Play-button again the music starts fom the beginning again WHILE the "first" music is still playing (I hear the music twice on top of each other).
Why and how do I solve the problem?
Here is the script which i have put in the first frame on a layer called "actions".
--------------------------------------------------------------
var music:Sound = new Sound(new URLRequest("Hallelujah.mp3"));
var sc:SoundChannel
var isPlaying:Boolean = false;
var pos:Number = 0;
stop_btn.addEventListener(MouseEvent.CLICK, stopMusic);
function stopMusic(e:Event):void
{
sc.stop();
pos = 0;
isPlaying = false;
}
play_btn.addEventListener(MouseEvent.CLICK, playMusic);
function playMusic(e:Event):void
{
if (!isPlaying)
{
sc = music.play(pos);
isPlaying = true;
}
}
pause_btn.addEventListener(MouseEvent.CLICK, pauseMusic);
function pauseMusic(e:Event):void
{
if (isPlaying)
{
pos = sc.position;
sc.stop();
isPlaying = false;
}
}
----------------------------------------------------
Thanks for your help!
Making A Motion Tween Using Actionscript?
Hey,
I just want to make some text scroll vertically using actionscript. I did it with frames first, but it looks kind of choppy. I've turned the text into a movie, with the Instance Name of textscroll. Now, what actionscript would move the movie from 0,0 to 0,-194.2 ...then start over or loop? Thanks in advance!
How Do I Quene A Motion Tween In Actionscript
I have a Slider bar under my menu in my website, that is a certain length. How do I make it get longer while it is slideing toward the button?
Is kind of what it looks like.
http://www.kirupa.com/developer/mx20...ith_slider.htm
Motion Tween Actionscript Malfunction
Hi!
I'm making a website to the company that I work and I'm having a problem.
The function only works on the first 30 frames of the scene?!?! Strange!
Here goes the .fla and if you see the "years bar" doesn't move has the other elements. But if you click on the [M Button] and next on the [P button] it works.
Why does not work on the other buttons.
I hope you can help me!
Thanks!
How Do I Quene A Motion Tween In Actionscript
I have a Slider bar under my menu in my website, that is a certain length. How do I make it get longer while it is slideing toward the button?
Is kind of what it looks like.
http://www.kirupa.com/developer/mx20...ith_slider.htm
Motion Tween Actionscript Malfunction
Hi!
I'm making a website to the company that I work and I'm having a problem.
The function only works on the first 30 frames of the scene?!?! Strange!
Here goes the .fla and if you see the "years bar" doesn't move has the other elements. But if you click on the [M Button] and next on the [P button] it works.
Why does not work on the other buttons.
I hope you can help me!
Thanks!
Motion Tween Color By ActionScript
I have 6 buttons that besides doing their original purpose, I want them to cause a certain movie clip to change it's color gradualy over a number of frames.. The problem is, that I can't do a regular tween, cause i don't know the color of the frame at the moment I am pressing the button.. I need somehow to define a function for this in ActionScript.. but how?
Motion Tween While Adjusting Alpha With ActionScript?
Hi, all. I'm hoping this will have a simple answer, but I can't seem to find it addressed anywhere. Without going into too much detail, I'm trying to create a slider that will adjust the alpha of an object in motion (specifically, changing size and location on the stage). Unfortunately, when I move the slider, the image fades in and out as it should but stops moving.
I understand that ActionScript supercedes motion tweens, but is there any way around this? Some command to tell it to go ahead with the tween after the alpha change, maybe? Or would I have to just code the whole thing, alpha, size change and all (and if so, is there a way to tween that without coding each frame seperately?)
As you might've guessed, I'm still pretty new to Flash. I do have programming experience, and I can usually figure out how to do what I need to do once I've got a foothold with the language, so any help in getting that foothold would be welcome!
Build Motion Tween Guide Using Actionscript?
im creating a mc consist of a map. i wanted to used a guide line if people wanted to go someplace in the map. i wanted to go from point a to point b, other time i wanted to go from point b to point a. can i use actionscript to developed? plz help me... it's for my thesis.
Actionscript Movement Corrupt The Motion Tween
I have a MoveiClip in my stage, I use actionscript to move it to some other position. It works great.But in some frames later I inserted a keyframe and I used the same movieclip for a motion tween. but this motion tween is not considered at all. what's the problem.... how should I fix it ?!
the main goal of doing such a thing is below :
I'm doing a game, in the desired movieclip there are some other of movieclips which will be visible / invisible due to some conditions. after finishing the game I want the same MovieClip ( with exactly the same properties of visible / invisible internal movieclips) to start a motion tween, but It doesn't start the motion.
Adding Actionscript To A Tween To Make A Motion SMOOTH Without Using Ease In Propert.
I want to know how people make there tweens soooo smooth
i play around with the ease in the properties panel.. and it helps but the effect is not as seemless as other effects i have seen.
i have come across a script that will make a smooth tween with only actionscript...but my negitive comments against that is...i like to see the actual tween and put it where i want. I don't want to mess with code and the x and y axises to put it where i want by trail and error putting in different types of x or y axises to put the shape that is being tweened in the correct spot. if i could only add some script to the tween i already have made it would make the process ALLOT BETTER ?
fellow flash kiters, is there an answer ?
Using Stop(); On A Shape Tween Of A Swapped Movie Clip Symbol Within A Motion Tween
Thanks a lot for your time. I'm new to actionscript, and language syntax and I never really got along to begin with so I appreciate any help in the matter.
Basically the title says it all - I made a motion tween in the main scene, made a movie clip symbol (to shape tween a gradient) and added a stop(); inside the gradient-tweened-symbol. I then swapped the movie clip symbol with the motion tween in the main scene, and got exactly the effect I wanted (the item moved, then tweened itself) but the stop(); seems to have no effect.
I know this looks like one of those "that idiot didn't google before posting" questions, but I've been looking for about a half hour with different permutations of stop, doesn't work, actionscript, and flash, and I haven't found anything that seems to target this problem specifically.
If you've got any idea what's going wrong, please feel free to respond or show me how to better seek help on my own. Thanks again.
Script Motion Vs Tween Motion Question
I have asked for help before on scripting that slows down text or smooths it out, etc.
My question is this.. (and i havent experimented yet so..)
If you were to use script to cause alpha changes and motion changes, as opposed to tweening everything, would it make the flash file move much smoother, especially if you had alot going on at one time???
It also should make the file quite abit smaller too correct?
Thanks
Tween Class Scaling Breaks Motion Tween?
I have a movie clip which uses a motion guide to animate the entry (and eventually the exit) of a bunch of other movie clips. These smaller clips contain buttons, and animate on rollOver and rollOut using the following code:
Code:
on(rollOver) {
this.swapDepths(2);
ParentxScale = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Back.easeOut, this._xscale, 100/.6, .5, true);
ParentyScale = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Back.easeOut, this._yscale, 100/.6, .5, true);
play();
}
on(rollOut) {
ParentxScale = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Bounce.easeOut, this._xscale, 100, .5, true);
ParentyScale = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Bounce.easeOut, this._yscale, 100, .5, true);
stop();
}
However, once an object has been moused over, it doesn't exit with the others. Any ideas why it seems to "fall off the track" of the motion guide?
Shape Tween Like A Motion Tween, Using Guide Layer
How if possible, can i make a shape tween behave and follow a set path (like using a guide layer)while morhping/tweening?
So far it seems as each time i try it always goes in a straight line from a to b and in this case that's not what i'm after.
Do I Use A Shape Tween? Mask? Motion Tween?
How do I make this arrow grow into shape? I want it to slowly appear...but not fade in...
it's hard to explain...but here is the arrow, hopefully you will understand what I want...
I tried using a mask, but instead of revealing the arrow little by little, it dissapeared little by little...(basically the exact opposite)...
I also tried putting a white box over it & motion tweening the box to reveal the arrow...but that didn't look good...
any ideas?...suggestions?
thanks in advance...
Change From Motion Tween To Shape Tween
I am trying to have a motion tween of some text move on the page and then change into a shape (i.e, a shape tween). I can't seem to make this work. I put a keyframe at each end of the motion tween and that works fine. Then I add another keyframe, delete the text and replace it with my shape. Then I select just those frames and add the shape tween but nothing happens. How do I accomplish this successfully?
Thanks.
Shape Tween / Motion Tween Problem
I must be missing something very obvious.
I have created a movie that draws a box, fills in the box with color and then is supposed to have the menu swoop in from the right. Mind you this is for learnnig, not cosmetic appeal Why is it when I use tweens I get the dotted line versus a solid line in the time line?
If you take a peek at the FLA it is obvious what I am referring to. I must be using the tween function or symbols in an improper manner.
I have attached the FLA.
Any help appreciated.
Thanks,
Kerry
www.skurz.com
Shape Tween / Motion Tween Problem
I must be missing something very obvious.
I have created a movie that draws a box, fills in the box with color and then is supposed to have the menu swoop in from the right. Mind you this is for learnnig, not cosmetic appeal Why is it when I use tweens I get the dotted line versus a solid line in the time line?
If you take a peek at the FLA it is obvious what I am referring to. I must be using the tween function or symbols in an improper manner.
I have attached the FLA.
Any help appreciated.
Thanks,
Kerry
www.skurz.com
Seperating Motion Tween From Alpha Tween
I am trying to fade in the alpha on a graphic symbol rather quickly at the same time the symbol scrolls very slowly up the stage, but the two seem linked, so that a very slow scroll means a very slow opacity gain. How can I fade the photo in quickly while the photo motion tweens slowly?
How To Motion Tween Thats Not Linear Using Script Or MC Tween?
If you wanted to do an animation of a ball that goes from A to B but not linear, how would you do it by code or Mc tween. How would you make the ball go in a curve line for example instead of a straight line from A to B?
I understand you can use a guide to get all types of non linear motion tweens on a timeline, but how would you do it using MC tween or coding.
Motion Tween (fade) Text Converted To Symbol No "motion"
I am using flash mx and my file includes text that is supposed to fade in and out.
I do exactly as I do with images - alpha 0 fades into 100 % etc, and it looks fine on the stage, but when I publish the text simply pops on and off with no recognition of the alpha channel fading in and out.
I create the text as static text - old english font - and then I convert it to a symbol. I tween the symbol from 0 to 100 alpha and back again. Presumably making it a symbol essentially makes it an image, right? no?
I am relatively new to flash so I may be missing something obvious?
(yes I have checked out places like flashkit.com, but not exactly what I am looking for, want more control.)
Motion Tween & Shape Tween In Same MC? How?
I have created a shape tween on my first layer. On my second layer I would like to create a motion tween. But the motion tween says it will not occur with layers with shapes or more than one group. Can anybody enlighten me a little bit on this.
Thanks for any help that is given.
Derek
MOTION TWEEN Vs. SHAPE TWEEN
What slows down a .swf file more?
I have a site I'm re-doing from scratch, and I see quite a few places I got lazy and used a lot of Movie Clips. I could use shapes and have the same result. The main .swf did suffer from a little slow down...
I've read most of the literature there is on the net [on this subject], and I was wondering what first hand experience some of you had?
I know you're going to say, "It depends...", but I mean...
as a rule... which plays faster/more taxing on the browser?
G
Motion Tween, Tween Back
hey guys, its been a while.
i have a pretty strange problem, strange in the way that i dont understand why its happening, any help would be appreciated.
im creating a bejwelled game.
what im doing is:
when you click on two adjacent blocks, i call a function that uses a motion to swicth them. This works great. The i call a function to test whether the move has resulted in a combintion of >2 blocks. If it returns false, i recall the previouse tweening function to reverse the blocks to their original positions, this is where my script breaks down, it executes the function but nothing moves !
Heres the relavent code:
ActionScript Code:
import mx.transitions.*;
import mx.transitions.easing.*;
var bt1:Tween;
var bt2:Tween;
var initBlock:Object = new Object();
var b:Board = new Board(); //external classes no issues here
var g:Game = new Game(); //external classes no issues here
var counter:Number = 0;
var x1:Number;
var x2:Number;
var y1:Number;
var y2:Number;
initBlock.onEnterFrame = function() {
this.onRollOver = function() {
this.gotoAndPlay("rollOut");
};
this.onRollOut = function() {
gotoAndPlay("rollOut");
};
this.onRelease = function() {
var s:String = this._name;
getClickCoord(s);
_root.counter++;
if(_root.counter == 2){
_root.x1 = g.fromX;
_root.x2 = g.toX;
_root.y1 = g.fromY;
_root.y2 = g.toY;
if(g.isValidInput()){
swapBlocks();
updateMcName();
updateBlockArray();
if(isValidMove()){
/* ommited for space */
}else{
trace("no combination");
//switch position variables
var m:Number = _root.x1;
_root.x1 = _root._x2;
_root.x2 = m;
m = _root.y1;
_root.y1 = _root.y2;
_root.y2 = m;
//change everything back
swapBlocks();
updateMcName();
updateBlockArray();
}
}
//reset variables
_root.counter = 0;
g.fromX = g.fromY = -1;
g.toX = g.toY = -1;
}
}
};
/* ********************************************
* Display blocks
******************************************** */
function display(a:Array) {
var k:Number = 1;
for (var i:Number = 0; i<6; i++) {
for (var j:Number = 0; j<6; j++) {
var blockName:String = "Block"+k;
var blockDepth:Number = this.getNextHighestDepth();
this.attachMovie(a[i][j].__type, blockName, blockDepth,initBlock);
this[blockName]._x = j*50+100;
this[blockName]._y = i*50+50;
k++;
}
}
}
/* ********************************************
* Get co-ord of click block, from block name
******************************************** */
function getClickCoord(s:String):Void{
var x:Number;
var y:Number;
if(String((Number(s.substring(5)) / 6)).length == 1){
y = (Number(s.substring(5)/6) - 1)+1;
}else{
y = (Number(String(Number(s.substring(5))/6).charAt(0)))+1;
}
if(Number(s.substring(5) % 6) == 0){
x = 6;
}else{
x = Number(s.substring(5) % 6);
}
if(g.fromX > 0 && g.fromY > 0){
g.toX = x;
g.toY = y;
}else{
g.fromX = x;
g.fromY = y;
}
}
// i knows it an insain way to do it, but it works fine for the moment
/* ********************************************
* Swap Adjacent Block
* - From (x, y)
* - To (x, y)
* ******************************************** */
function swapBlocks():Void{
var s:Array = b.getBlock();
var block1:String = "Block" + String((_root.y1-1)*6 + _root.x1);
var block2:String = "Block" + String((_root.y2-1)*6 + _root.x2);
if(_root.x1 == _root.x2){
var blockTween1:Tween = new Tween(this[block1], "_y", None.easeNone, this[block1]._y, this[block2]._y, .5, true);
var blockTween2:Tween = new Tween(this[block2], "_y", None.easeNone, this[block2]._y, this[block1]._y, .5, true);
}else{
var blockTween1:Tween = new Tween(this[block1], "_x", None.easeNone, this[block1]._x, this[block2]._x, .5, true);
var blockTween2:Tween = new Tween(this[block2], "_x", None.easeNone, this[block2]._x, this[block1]._x, .5, true);
}
}
/* ********************************************
* Update MC names
******************************************** */
function updateMcName():Void{
var s1:String;
var s2:String;
var block1:String = "Block" + String((_root.y1-1)*6 + _root.x1);
var block2:String = "Block" + String((_root.y2-1)*6 + _root.x2);
s1 = block1;
s2 = block2;
this[block1]._name = "bob";
this[block2]._name = block1;
this["bob"]._name = block2;
}
// working fine
/* ********************************************
* Update block array
******************************************** */
function updateBlockArray():Void{ // working fine
var s:Array = b.getBlock();
var t:String = s[_root.y1-1][_root.x1-1].__type;
s[_root.y1-1][_root.x1-1].__type = s[_root.y2-1][_root.x2-1].__type;
s[_root.y2-1][_root.x2-1].__type = t;
}
display(b.getBlock()); // working fine
sorry for the size, i trie to cut out as much as possible.
ive debugged the code a hundred times everything else dose its job, as far as i can tell the tween AS just isnt working.
Thanx in advance.
No More Choppy Motion I Want To Learn Motion Using Actionscript
Hi, my experience is with motion tweens from point A to point B, clean and simple but notice the animation is VERY choppy on slower computers... I want to learn how to alpha, move from point a to point b with actionscript rather than simple motion tweens so the animation is SMOOTHER.... any resources I should check out? Books? Tut's to search for (I haven't had much luck searching).
Here's a sample of my Flash work using simple motion tweening:
http://www.workplaceinnovationsllc.com/flash.htm
Works great on a powerful computer but not on older slower machines..... you'll see where better scripting could make this site better, smoother.
Thanks!
Help!
Motion Tween
i want to know how to motion tween with actionscrtipt.. like a slidding scrollbar.. i want it to slide... to the other side.. how do i do this? what is the MAIN script?
Motion Tween Help
how can you slow down the motion tween, with out adding more keyframe
Motion Tween Q
Hey. Just starting out on flash 5.0 and I'm trying to create alittle short flash movie. I am trying to do some motion stuff (of course) and I only want one little picture to move in the whole frame. I cannot seem to figure out how to do it (motion or shape?) and if I try motion tween, it moves the whole frame instead of that one image. So what other layers or motion guides do I need and what am I doing wrong?!? Thanks for your help, swampfox
Check out http://www.JackassOnline.net !
Motion Tween?
Motion Tween: I know what it is.....but how do I get to the menu where I can use it?
|