ActionScript 3.0 :: Controlling The Number Of Bounce Using Easing Class?
Feb 20, 2009Is there a way to control the number of bounce when using Bounce.easeIn ?
View 2 RepliesIs there a way to control the number of bounce when using Bounce.easeIn ?
View 2 RepliesI have this code in a button. I want more exaggerated easing, but more importantly, a "bounce." What I mean by this is on rollout, the button seems kinda sticky and jiggles back and forth a little.
code:
onClipEvent (enterFrame) {
if (_root._ymouse > 50 && _root._ymouse < 150) {
_root.yChange = Math.round(_root._ymouse-this._y);[code].........
I've been trying to find an easing generator that supports bounce but have found none. I want to create an easing function that starts as a easeInSine (or quad) and ends as en easeOutBounce (imagine dropping an object on the ground). I've already thought of splitting up the tween in two. Just realised that the easeOutBounce actually starts a little bit like easeInSine but I would like to enhance that part to make a steeper curve.
View 4 RepliesIs the number in a function representing the speed (in case of easing) equal to a certain amount of frames?
View 10 Repliesive been searching around about tween class easing in as2 and ive found this great tutorial URL...need a help though, im not really a actionscript programmer, but i wanted to modify this code:Code:import mx.transitions.Tween;[code]how would i modify the code so my objects not only goes on a straight line(_x like in the code from 0x to 400x), what if i wanted a diagonal direction, it will start in x and ends in y?
View 1 RepliesThis is probably something simple but I'm scratching my head over easing with the Animate class in Flex 4. Basically I'm just trying to set easing via:
[Code]....
Which would be fine, except... the constructor argument is a Number, not an instance of EaseInOutBase. All of Google's results suggest that this should be defined via MXML, but I just feel... dirty doing it - rather, defining something that is purely programmatic with markup. I know that's half the nature of Flex, but still, I like to keep most of my logic/configuration in AS3. If there's a better way to animate with easing than using Animate with its easer property (eg, if this isn't the right way)
How can I use the easing in the addTween method of the Tweener class?
View 2 RepliesI have an issue I've tried to import these tween classes. I get the errors below
ActionScript Code:
Scene 1, Layer 'Layer 2', Frame 1, Line 1 1172: Definition com.greensock could not be found.
Scene 1, Layer 'Layer 2', Frame 1, Line 2 1172: Definition com.greensock.easing could not be found.
Scene 1, Layer 'Layer 2', Frame 1, Line 1 1172: Definition com.greensock could not be found.
Scene 1, Layer 'Layer 2', Frame 1, Line 2 1172: Definition com.greensock.easing could not be found.
it was possible to control the number of tick marks the Flex DateTimeAxis displays along its axis? Currently, the datetimeaxis controls how many tick marks to display on its axis whenever I change the date range on my chart. Ideally, I would just like there to be only and always 7 tick marks no matter how many datapoints are on the chart. I went into the DateTimeAxis class and noticed that there is a public function called transformCache(), which actually handles rendering the tick marks on the axis but I am not sure what class calls this method.
View 1 Repliesim trying to create this custom menu a bit more efficiently. As written, it operates fine glitch free. However, id like to incorporate some easing into the movement of each movie clip.
[code]...
how to incorporate tween classes and then easing?
I've built a code to cyclically move a scene on the bottom of my stage; I've done this to make a slowing-and-stop-easing effect at anytime the command will arrive. The entire scene mc is _x long something like 6000 px. The whole code goes in this way:
1) importing on the stage (with attachMovie) a mc with this code inside:
onClipEvent(enterFrame) {
_parent._parent.fondo_mc._x -= countermovement;
if (_parent._parent.fondo_mc._x <= -5800) {[code].....
The code goes right, but I need to improve it.Now there is just a variable, I tought to use two vars to implement the whole code in a setInterval, but maybe it's unuseful, and actually I can't use it in the right way.
Second issue: actually when slowAndStop function is called the scene slow too fast, if I take it to 15 it slow better but the scene is running too fast...
The best would be that the scene slow down and stop following: A) a temporal variable (and I can try to implement it with setInterval, that for istance is a cycle)
B) an indipendent moving variable, so that on one side I set the speed, on the other side I set the slow-and-stop in a matter of time with countermovement.I also tried to use a second variable:
var counter:Number = 15;
// set the _x increment
var countermovement:Number = counter/2;
but the scene slow and goes backward a bit
I'm familiar with how to ease something in using motion math. Easing out would not be that bad either. But how would I script something easing in half way, then easing out the second half? It would start slow, gradually move faster, then slow to a stop at the end. - almost like a sine wave I guess?
View 1 RepliesI have a class the extends a movie clip with some dynamic content in it.I need 15 instances of this class so i created a for loop for that.Im using the same variable name but im just initializing it again and again.
var thumb:MovieClip = new ThumbClass();
addChild(thumb)
my probem is that i need to find a way to control them after i created them.
[code]....
I am trying to control 'blur' from within a movieclip's class. But I don't know why it doesn't do so. I can do everything from within that class (control textfield's caption names,etc) but I just can't blur it , using the BlurFilter class. Here is my short code. Is there any problem in doing this from a class? I tried the code on the movieclip directly without using classes and it worked..
Code:
import flash.filters.BlurFilter;
dynamic class txtField{
var xTip:Number = 0.3
[code]....
I have a main ButtonClassTest class that extends the MovieClip class. Then I have a ButtonTest9 class that extends this ButtonClassTest and a ButtonTest9.fla.It works fine (click, rollover, etc) when I link a movieclip in the library of my ButtonTest9.fla to ButtonTest9 and place instances of this mc on stage (button1_mc and button2_mc). However, I'm not being able to control anything about the instances themselves, like, setting button1_mc.alpha = .5 in my ButtonTest9 class.I tried a whole bunch of things, like Stage., this., putting it into functions, not linking the mc in the library and using new ButtonTest9 instead.
View 2 Repliesi have two movieclips on stage, one load as a class an mc with animation, the other load a button...how can i send the message, comunicate both clases to let the button start the animation?
View 4 RepliesIs it possible to start and stop a sound file from a separate class? In the first class, "House", I have called the MP3 using the following:
[Code]....
so here is the thing: I have a movie clip with 12 frames (lets call him MC), each frame shows a symbol. I want to create a class that control the MC instances, (lets call that controlClass) the controlClass will have function to change the frames of the MC instance and some other stuff. last thing I tried is that you give the constructor of the controlClass the instance name of the MC and tried to do that for example: stage. + MCInstanceName + . gotoAndPlay(2); that's what I'm trying to accomplish, at least.
View 4 RepliesLet's say that I've a button object (instance of Flip) and a coin object (instance of Coin) on the stage. The coin object has two frames: one showing Heads and one for Tails.
MyCoin class is as following:
package
{
import flash.display.MovieClip;
public class Coin extends MovieClip
[Code]....
Problem: How do I reach the coin object on the screen via onMouseClick function? Let's say that the object on the stage has instance name of myCoin. I suppose that had I not done this with an external class and simply used actions from the frame I could just use the instance name as a variable. I couldn't figure to do the same it in an external class. Do I first create the object which is already on the stage?
Is it possible to start and stop a sound file from a separate class?In the first class, "House", I have called the MP3 using the following:
Code:
public var mySoundReq:URLRequest = new URLRequest("tune.mp3");
public var mySound:Sound = new Sound();
[code]......
I have a gallery, which loads up all its images from an XML file. So the XML gets loaded, when loaded it calls a function urlLoaded. That in turn puts uses a Thumbnail class for each image in the XML, which then gets placed in an array, so the array can be iterated through to establish X and Y pos of each image when added to the mc Photocontainer.
PHP Code:
var urlRequest:URLRequest = new URLRequest("pics.xml");
var urlLoader:URLLoader = new URLLoader();
var xml:XML;
[Code]......
I'm passing the parameter 'i' through to the tracel function as this traces when each image has finished loading. I have a preloader in the main timeline I want to control. Say there are 20 images, how do I use the info in the tracel function to control that preloader? Would it be best to pass into the Thumbnail class the xmlList.length(), so the number of total images and then from the tracel function add and control a preloader, so when image 10 is complete the tracel function would make a slider its added to stage go to half way.
I have a compiled swf File (lets call it "cat.swf") that is loaded via the Loader Class of my Main movie. The cat appears without problems. But inside cat.swf there are two movieclips defined (lets call em "head" and "body"), and I have ye to find a way to get control of these from my Main movie.
When I check for numChildren of the loader Object it only gives me back one (an unnamed instance), if I cast that as a Movieclip to check for deeper children it continues all the way down like a tower of turtles.
I tried to take similar code from this same forum, but I was either getting an error 1118 or an 1009 (null object reference).
Basically I have a series of movie clip instances on the stage with instance names of:
number_1
number_2
number_3
[Code]....
I tried but I kept getting an error...I think I am a little confused as to how to make it work properly.
I have this following class attached to some of my buttons to simply control the roll over and out states, as well as the click event. But i want to use the same class on my buttons but would like to control a movieclip outside of the button somewhere else on the stage etc.
put simply: Clicking my button 'moveLeft' will move a movieclip left let say:
[Code]...
I'm a little new to AS3, but I have a question. I have a variable called "lives". It is a Number. I also have a class. It is called "Enemy". Within the "Enemy" class, there is a function called "collision_detection". How can I change the value of "lives" from "collision_detection"?
I have an Enemy class. I need to communicate from within the class to let the main program know that a collision occurred. How can I send this message to the main program?
[Code]...
All I want to do is increment a counter every time a movie loads. I have a method (updateMovie) that is passed an MC and the url of the swf to load into it. My loader listener object then triggers another method that should count the number of movies loaded. For some reason I can't access my counter ('loaded').
Here is some of the code from within my class:
[AS]
private var loaded:Number = 0;
//loads passed swf into mc
private function updateMovie(mc:MovieClip, url:String) {
[Code].....
I was thinking of making a complex number class but then realized it would be a bit of a pain to have to call functions every time I wanted to perform operations on them. Would there be any way that I could set two complex numbers like so:
Code:
var z:Complex = new Complex(-0.7, 1.4); //where the number is then -0.7 + 1.4i
var c:Complex = new Complex(1, 1.1);
and then store the result in another?
Code:
var x:Complex = z + c;
In other words, is there a way to make the +, -, * and / operators behave in ways other than those they normally would?
I need a way to "extend" or proxy the Number class in ActionScript.Basically I'll overload the toString method of it. But the Numbers should remain comparable with "<" and ">" operators.
View 2 RepliesHere is my code:
package
{
import flash.display.MovieClip;
public class Derp extends MovieClip
[code]...
What I would like to do somehow assign a number or word variable to display one of the public classes on the screen instead of all of them at once.
test.fla has the document class test.as. This is test.as:
Code: Select all// test.as
package
{
import flash.display.MovieClip;
public class test extends MovieClip
[Code]....
Why is it so? I want to be able to output the value of number through the document class like I showed in the code of test.as above.