Piston Crankshft AScript Motion Help
Hey there I am a newbie to Flash and need some help. I tried and researched for a good while on the Trig involved with creating an accurate movement of an Engine piston and Crankshaft.
Eventually, I will make an actual crank someone can use an adjust the speed to work. Currently, the driving force is a dragable button where the wheel follows and moves everything else.
Basically, I am wondering if any of you Flash geniuses can help me optimize this code...as I am sure it is not efficient. Plus critique it too if you will.
There is also a slight problem with the crank rotating where the piston and crank attach but I am unsure why. The code SEEMS ok. Thanks in advance for any help. This is as far as I could get on my own...and boy, was it hard enough. I'll try to post a working example link if I can get somewhere to host it. Thank you.
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 01-14-2005, 08:44 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Start & Stop "Piston" Movement With Actionscript
Does anyone know how to code where you can use a start and stop button that starts a piston moving up and then down on a guided y-path. When you push the stop button it stops where it is, then when you push start it begins from the same spot. I am not sure how to code this. Any help would be great
Which AScript Is Better?
greetings:
I have a site with a sliding menu panel and I need MCs on that panel to animate (expand) when the MC appears in the center area of the stage and retract when the panel slides the MC out of the center.
Should I set up an if then for the values of the _x. coordinates of the MC, or perhaps instance another mc occupying the center 1/3 of the stage and do a MovieClip.hitTest function.
Does anyone have any thoughts or know of any source fla.s with something like this?
any help is good help
thanx
AScript Problem--Help?
I have an fla which is made up of 5 scenes. The final scene is where you end up and is essentially a web page. The first scene is an old-style movie projector countdown, which I want to function as a pre-loader--which Im not sure how to do either. But the problem is, I borrowed some code from a flashkit tutorial when I built the countdown that gives a movie clip of a line and a dot random scales and random positions and duplicates the dot clip. This gives it an old scratched up movie effect.
However, when the movie proceeds to the next scenes the movie clips of the line and the dot are still there, but the don't move. I dont want them there moving or static.
So i tried load movie and loaded a swf of just the countdown, but I cant control it's size and position? I would like to scale it and center it?
Next I tried loading it in to a cointaner clip, but if I do that, it loses the random movements of the dot and line clip and they are just static?
Also, I want the coutdown to stop and go to scene 2 once the entire movie is loaded. Right now each scene is a series of loaded swfs? Is it possible to do that or do to actually put the scene content in each scene.
In addition, I would like it to have a skip intro, but beacause of the linear nature, everything has to be loaded first before you can go the final scene which is the web page? Do I need to re-arrange the way I have this set up and put it all in one scene with frame labels or Is there a way to set it so that the final scene loads first and you can skip to it rather than waiting for the itermediary scenes to load and play?
Loading Into Mc And Ascript
hi,
again talking about loading an external swf into a movie clip of our main movie,
the reason is to mantain layers structure of the main movie as well as actionscript of the external swf,
do any of you knows why some actionscript does not work ???????
example:
the external swf has many mclips with the vissibylity turned off,
and they turn on wher you rollover a button,
this vissibylity thing does not work,
any idea why ???????
thanks,
Fullscreen Just Misses - Here's The AScript
Been working on this for some time
My goal is to have NO boarders at all.
here's the site:
http://www.geocities.com/dkjvsite
Here's the AS:
on (release) {
getURL ("javascript:window.open('http://www.geocities.com/dkjvsite/dkjvsite.swf','welcome','width=1024,height=768,top =0,left=0,toolbar=no,scrollbars=no,resizable=no,me nubar=no,status=no,directories=no,location=no'); void(0);");
}
My goal is to have NO boarders at all.
I dont use 'publish' with my Flash 5.
I just test movie then embed the .swf on a page using Dreamweaver.
I'm gonna figure this out TODAY!
right after a morning nap...
thanks.
[Edited by gogon on 06-16-2001 at 09:08 AM]
Anybody Got A Clue? Windows/Ascript
I found a site where the opening window goes from very small to full (maximised)on its own, i think it's actionscripting.
Anybody know how to do this?
This is the site
http://www.noinc.net/launch.html
Thanks,
BLAKEY
Pause / Delay In AScript
hi!
i'd like to make a frame in a movie clip pause, that is display for a certain time before progressing to the next frame. any ideas?
thanks! -jack.
Advantage Of Ascript? CPU Friendly?
I've been trying to be a good flash user and learn how to
tween and fade using ActionScipt.
I see that it allows percise control and exact timing...
But does it make it easier on your CPU??
Let's say I'm animating a bunch of water waves. Like 15.
I tweened and faded by hand. It's a lot for the CPU to handle.
All the motion and the layer after layer of alpha effects.
If I figured out a way to Script it...would it still be just as
hard on the computer?? Does AScript improve CPU performance or just file size??
File size doesn't matter as much...it's for a CD-ROM.
Thanks....
Listbox As Menu - AScript
Sorry my AScript knowledge is basic and so wish to know if this is possible and how to do it. I wish to use the Flash MX Listbox component as a menu so that when a menu item is selected it will gotoAndPlay("a Frame Label") in my main timeline.
I have tried putting this code in the data field however no luck.
Thanks for any help.
Loading Swf After Ascript Scales Mc
I've got a background that scales depending on the button pushed (and the size of the loading swf, but I think I'll keep it easier and make it determined by the button - so approx. 5 sizes). I need the swf to wait until the mc scales, the load, so that it looks sequential.
This has been done a million times and I can dig up an example if no one is clear. Any tutorials or suggestions would be great.
Thanks,
AScript Error When Following Tutorial
Hi,
I'm new to all things flash but I belive I followed this tutorial exactly to the point and I still get an Action script error. I would really like to put this thing on my site so any help would be grately appriciated. The tutorial in question is "3D Flower" by V. Ramraj. Link:
http://www.flashkit.com/tutorials/3D...-801/index.php
I needed the animation to be only 164x164 pixels so I made sure to omit the fullscreen option and I changet the variable that states is supposed to b half of the canvas size. However I get this error when I try to preview the movie.
code:
**Error** Scene=Scene 1, layer=Scripts, frame=1:Line 8: ')' or ',' expected
wire.DuplicateMovieClip("l" add i, i);
**Error** Scene=Scene 1, layer=Scripts, frame=1:Line 9: ')' or ',' expected
line[i] = eval("l" add i);
Total ActionScript Errors: 2 Reported Errors: 2
I am also unable to attatch any action script to the button as stated in the end, and also the changing color tween is vry poorly explained so if someone could give me a few pointer o that one or link to a tutorial that would be great. I am using Flash 8.
Thank you in advance
-fr33m4n
Alpha Fade AScript
I've been trying all night... I've even tried modifing a script I have for x,y motion tweening but I can't figure it out.
I need to be able to:
OnPress = Alpha 100%-->0%
And Vice Versa.
And I need to be able to attach the script to a movie clip, where the operator would be a button.
HEre is the script I've tried to modify to do it:
PHP Code:
//during the time the movie loads, we set the current
//position of the content at 0,0; thus showing the
//HOME section of the site.
onClipEvent (load) {
_x = -200;
_y = 0;
div = 5; //This value just determines the speed
//the transistions.
}
//Here we constantly check for new values of
// _x and _y. These values are determined by endX and endY.
//We divide the difference by div to have an value that
//continues to change until the equation is true.
//Try changing the 'enterFrame' with 'Load' to see the
//difference. You would then have to click on a button
//several times before the transistion completes.
onClipEvent (enterFrame) {
_x += (endaX-_x)/div;
_y += (endaY-_y)/div;
//We then use the onRelease method to determine the
//new values of endX and endY. This is a new feature
//in Flash MX.
_root.portfolio.onPress = function() {
endaX = 0;
endaY = 0;
};
_root.portoflio.onRelease = function() {
endaX = 0;
endaY = 0;
};
_root.about.onPress = function() {
endaX = -200;
endaY = 0;
};
_root.contact.onPress = function() {
endaX = -200;
endaY = 0;
};
}
Thanks in Advance
Flash MX AScript Version
Does Flash MX run actionscript 2.0 or an earlier version? And if it doesn't run 2.0, can I import classes and packages like I can with actionscript 2.0? Thanks.
Easing/AScript Tween Question...thx
Quick "how-to" question:
I am trying to create an effect whereby clicking on a button will trigger an "eased" tween- specifically targeting a MC, which will hopefully go gracefully from one position to another. In the finished product, there will be several of these buttons, each linked to a single MC to control. Can anyone point me in the right direction, code-wise, of how to accomplish this in ActionScript?? Thanks in advance...
AScript For Loading External JPGS
If anyone can point me in the right direction-
i've tried making a flash portfolio w/embedded jpgs-
which results in a huge swf that takes forever to load.
some people suggested i use a script to load the
jpgs directly off my server.
Is it more than just LOADMOVIE?
Do i need to make a preloader for each jpg?
thanx
Changing Gradient Color With Ascript
hi there -
i have a shape that has a gradient fill - i want o change this gradient color from blue to red with the click of a button
how would i do this?
thanks a lot!
Web Site For AScript Sample Lessons
SAMS Teach Yourself Flash MX in 24 hours references a CD-ROM but I understand there is a web site where one can download each lessons completed sample to check to see how one is doing with each lesson.
I checked my book out from the Denver Public Library but no CD-ROM was included. Any one have any idea what this site would be. I checked out and found no reference to any help at www.developerdispatch.com
Any help would be appreciated.
Using Ascript To Resize Stage And Change Res Dynamically
The movie I am creating needs to be played on 2 formats:
1. The web
2. via CD
My problem is this: I need the cd version to have a stage size of 1024/768 and the bitmaps i use to be quite high resolution, however when the movie plays on the web, I need the stage to be smaller and the res to be less so the download time is cut down. I also asked earlier about converting framerate, but thats another issue. So, is there a way in actionscript to use some type of flag to identify whether the movie is being played over the web or on a cd, and thus resize the stage, its contents and tone down the resolution. If not, can you think of any other solution to this. I would hate to have to basically do the movie twice.
Is There A Way I Can Dload Certain Files Off Of A Swf That Load Via Java Or Ascript?
I founmd a website that has the "container" SWF and when you click on its menu options, it loads a new page, and theres a part where the music is absoltuely BEAUTIFUL.
I am a noob character animator and I was just very interested in using it for personal use. I've never pblicily published or gained even internet fame with my animation in my life.
was there a way I could get this music file?
its a site called Moviola.com
I tried downloading the main.swf but like I said its a container file that really doesnt include anything
[F8] Real Basic Click Game - Ascript Help
I am trying to create a real simple interactive game where:
on the left we have 6 buttons
On the right we have six jigsaw pieces
click Button 1 and only piece 1 animates into place
click Button 3 and only piece 3 animates into place
click Button 6 and only piece 6 animates into place
At the moment if I click Button 6, all pieces will animate into place before piece 6.
The code I've used on the buttons is:
on(release){
Piece1._x = 597.5;
Piece1._y = 191.7;
}
and give Piece1 (mc) an instance name of Piece1
I've read tutorials and tried, but cant make sense of why it wont work.
Yep, you guessed it I'm REALLY NEW to this ... and ...
Thanks for reading
AScript For Limiting Movment On A MC When Start Drag Initiated
I am looking for code that will allow me to limit the movement to 50 pixel squares on a grid with a MC when the MC is being dragged.
example:
user drags object...
if the object is between 0-25 make the x coordinate 0 if it is between 26-75 make the _x coord 50.
This code isn't working for me:
on (EnterFrame) {
if (this._x >= 0 && this._x <= 25) { this._x = 0 }
if (this._x >= 26 && this._x <= 75) { this._x = 50 }
}
Is there anyone with an alternate solution?
Thanks in advance.
? Controlling Play Head For A Certain Number Of Frames Whit AScript
How about that I want to crontrol the playhead so that I can play a certain number of frames ( lets say 20 ) and then stop. All this whit only action script.
Not a Action in a frame but only a Button Action.
Ex:
I have a button that when I hit it the play head goes at frames 50 of a movie clip and stop after 20 frames of playing ( so it is now at 70).
But the Idea is to have no action in the frames of the movie clip that the play head is moving in!
Is it possible? Or I am just out of range whit this Idea ?
Embedding Hard Returns In Dynamic Text Fields Created From Ascript
How do I insert a line feed in a text field declaration such as
[code]
ourMovieClip.lyrics.text = 'xx:xx:xx';
[code]
I assume there is an escape character but a quick search didn't yield anything.
oh... I'm assuming I have to have html enabled? What about a nonHTML muliline field.
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
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!
Shape & Motion Tweens With Motion Guide? Can It Be Done?
Hello everyone
I am currently trying to make a line shorten gradually as it moves.
In other words I want to combine a shape and motion tween, using a motion guide to direct it.
Could someone supply an explanation for how to do so??
Thanks
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
[as3] Motion Guides And Motion Code
Adobe's touting Flash CS3's "Copy Motion as AS3" feature as a bridge between designers and developers. For the most part, I bet they're right. And there are probably other applications for the Animator class that we can't forsee at this time.
But I thought this feature's greatest use would be representing complex animation elegantly in a programmatic way. Simple animation can just be coded; it's the tough stuff that we'd prefer to animate in the Timeline, then convert to code. And Adobe seems to agree; their demonstration for this feature uses a motion tween that uses a motion guide, which is translated into Motion XML. But if you look closely at the XML, it doesn't describe motion at all: when you copy motion along a path as AS3 code, it'll first convert the entire tween to keyframes. That means, if you want to make the XML animation twice as long, you'll need to properly adjust the keyframe positions for each frame that was in the animation. That doesn't cut it for me.
On the other hand, if you just copy and paste the motion to another object, the guide will also be copied. This makes more sense; the Animator should be able to rely on a motion guide just as the Timeline seems to do.
Go ahead and give it a try. Make a little motion tween that uses a guide, copy and paste it as AS3, and look at the XML. Isn't it impractical?
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..
im experimenting on a motion pictures project... i want the actionscript to handle the imported jpegs in differant frames such as if the mouse is on the pic (rolover) it goes to the next frame wid another pic.. and if its not on the pic then it doesnt go to the next frame...
you can also go to http://moiz.topcities.com to see the current project... i m talkin about this particular project...
reply asap....
thanks in advance
In Motion..?
Is it possible to motion tween a motion guide..?
Motion Help
My question is how to make smooth motions with objects. Forinstance, when an object moves to a new location is sort of settles into that new location. All I can do is have to zoom right over to the new location and stop on a dime.
Motion
OK, 2 questions here (you might want to go here first www.neostream.com)
1.)In the animation @ neostream.com, if you click Upcoming a little flame follows your mouse. how do you make an object follow the mouse
2.)you will notice that the flame keeps animating while it follows the mouse even tho it is an object. how do they do that?
-rEgards from the biggest newb of em all
No Motion
Can anyone help. have only been using flash for 2 hours.
I an trying to rotate a symbol on the stage using motion tween. It seems to work fine when using enter to watch the movie on the stage. When i publish or test scene or movie there is no rotation. Any ideas what the problem is? Thanks.
Motion On A MC
I three movie clips that I would like to assign motion to when a button is pressed. I can make the movie clips move to the desired location, but they jump there, they don't "move" there. I'm using a loop:
y_val = opinion._y
while (y_val > 126.4) {
y_val = y_val-3;
opinion._y = y_val;
}
The first frame my movie places opinion.y = 300, I want it to move to opinion._y=126.4
Like I said, it moves there, but it jumps.
Any suggestions? Thanks!
Motion
I get how to make objects move across the screen, but i've seen some flash videos where they have just an arm moving. Do i need to draw it out in different scenes or is there a way to make it move with the motion or shape tween?
Better Motion
Im trying to make a button but im having problems with its motion tween, i need its movement to look more like these buttons on this site http://www.mousegraphics.gr/ can anyone tell me what changes must be made to achieve this?
Motion
I want to make it so that when u click a button there is a line that moves up 50 pixels. only when u click the button though. please help me. and i want it in actionscript. please help me.
Motion From Xy To Xy And Beyond
I did a search on these forums for xy and read almost every post but still couldnt find a resolution so i guess ill ask.
http://sd.arc-ufa.com/move.html
What i am trying to do is on mouseclick have a MC go from the ship in the direction of where ever the mouse is. Up, Down, Left, Right, Down-Right, etc...
examples:
http://sd.arc-ufa.com/img/img1.gif
http://sd.arc-ufa.com/img/img2.gif
The MC i want to tween is called: laser
The green ship looking thing is called: ship
I am very new to actionscript so the more detailed explainations the more helpful. I'd be greatful for any help anyone can offer.
thanks.
Motion?
i don't know how to ask but take a look at this site http://www.chaoticconstructives.com/ the pages are moving when is changed to another section...what i mean is the movement is done with actionscript right?so how to do that?
AS3 Motion
Hi,
I'm trying to find out about methods of creating motion using AS3. (Essentially replacing tweens with actionscript code)
I've tried using the 'copy motion of AS3' method. Although this achieves what I want it seems the code adds 16k to any swf file. Regardless of the complexity of the motion involved.
I assume this is due to the 'import fl.motion.Animator;' bit of the code.
I've seen that there are many other 3rd party motion controllers for actionscript3 but they all seem to use the same import of external code to create the motion.
I just wanted to know is there a way of creating a tween in AS3 without adding more than 1k at the most to file size?
16k is just crazy!
Thanks,
Ollie
Motion
Hi
visit this site (http://mattstaver.lighthousewd.com/new.html). On entering the site, click any gallery. Notice how the thumbnails enter the screen from the left.
I need help in the following:
My question is, how can I build the exact thumbnail motion when they enter the screen in the above site example???
Any help would be appriciated
AS Motion
Hi,
This seemed simple to start with, but I can't for hte life of me work out how to fix it...
I'm just trying to create a vertical sliding motion on my thumbnail menus. The menu starts outside of the stage (which I think is the problem) and slides onto the stage after a button is pressed. Somehow, I think that the -/+ _y values are screwing it up.
fla attached, I'm sure it is simple, but I'm really confused. The actions have been applied to the first sliding menu only.
Thanks.
HELP: MOTION?
Code:
var xSpeed:Number = 10;
var xEasy:Number = .6;
//var xStop:Number =
ballX.onEnterFrame = function ():Void{
xSpeed *= xEasy;
this._x -= xSpeed;
}
I made this script to move my movie clip "ballX" to the left and stop and I want to return it back. How do I do it?
I want move the ballX few pixels to the left and then back to the right. I want to move let say 20 pix to the left and 20 pix back, I know how to do it with position of _x, but I want this "ballX" put it anywhere on the stage later on.
Motion Fx´s?
Hi..ok, i know many people hate TM, but I think the fx´s on there are cool..I dont want to buy or rip anything from there, so I wanna try and make my own fx´s..similar to some on there. I am interested in the fx´s that are like spinning interface windows. I am guessing its kinda done on 3D program, then photoshop fx´s? like motion blur? Does anyone know of any tutorials? or maybe does some1 have the time to gimme some steps to doing something like this?
Thanks!
regards
M
|