ActionScript 3.0 :: Mathematical Function That Will Return A Number Based On A Graph That Starts At 0?
Sep 23, 2009
I'm completely useless at maths due to paying no attention whatsoever to it in school when I was a kid so forgive my lack of knowledge of basic terminology.I need a mathematical function that will return a number based on a graph that starts at 0, curves to (eg.) 100 and then curves back down to 0. I have a feeling it has something to do with Math.sin or somesuch wizardry but am not sure.Basically, I want to feed it a number between (eg.) 0 - 60 and for it to return a number on aforementioned curve. The purpose of this is to be applied as a lateral force on some basic ball physics. The idea of the 'curve' is that (depending on timing of the shot) there will be a 'sweetspot' in the timing.
what Have I done wrong! I want 'time' to return a number from the function it fires, So that it gets placed into the alphaTo Function ....> have a look
Code: blocks = 6; for(i=0;i<blocks;i++){
[code]....
So you see that I want to return a Number to 'time' ... How do I Return the Number?
I've an app which has requested for the "user_photos" permission. I've been trying to get the picture data with a photo id. eg. [URL] but I keep getting the error below:
"type": "OAuthException", "message": "A user access token is required to request this resource."
What I'm actually trying to achieve in the end is to retrieve the cover_photo of every album a user has. I'm using the AS3 Facebook API's Facebook.getImageUrl(id) function - which is working well with profile pictures - but not this.
I'm trying to create a function that draws a polygon with two parameters that are: number of sides and length of sides. You would input a number for side length and a number for the number of sides. Then it would draw the side length, then turn at a angle based on the number of sides, then draw side length again... until it has finished drawing the polygon based on the number of sides that were put in.
I am using a SildeShowPro for my project. I am trying to write an event listener to the onImageData event and create a conditional that will listen to the final image based on it's number id. Basicly I neet my movie to go to frame 60 after my gallery loads in its last image (number 10). Now, since I am not really familiar with the subject here is what I put together and it does not work...:
I have been searching the net for a tutorial how to graph functions. I found one from Barbara Kaskosz, very detailed, and too much scripting. Too much for me. Is there another way or place to learn, or I am doomed, and have to face the music and study her stuff. All I want, is to be able to graph a simple function.
[code]I want to input a number and find a match for the number, returning the values on the row in to specific fields for each number. For example, if I input the number 10 in an input field, I want the number 1.2276, 0.00100, 106.38 and the rest of that row to output these values I have seen so many options, don't know where to start.
I can't think of a way to write a function that returns an object that is loaded from an external swf. I need to be able to make a function that waits for an event listener before returning the value. I want to be able to create objects that can load in external swfs with minimal and no redundant code.
Here is the over all logic of my function:
Code: //First create an object and set it to function that loads in an external file var MaskFrames:Object = loadFile(parentObjectName, "swfs/", "file.swf"); //Create the function that returns the loaded swf as an object
Working on a linear movie and I want to do dynamic page numbers, i.e. when on the page, display that you are on page "x" of "xtotal" I created a dynamic text box, and tried to set it equal to ._currentframe, but that didn't work. Is there a way to do this?
I want to be able to return the number of specific movieclips on the stage.
For instance, i could have multiple movieclips like so on stage.[code]...
Is there a way to return the number of 'myMovie' movieclips that are on stage (4 in this example)? I guess this will involve using a 'for' loop and returning the number?
Code: function getHighestWidth():void{ for (var i:int = 0; i < myXML.video_title.length(); i++) { trace(String(myXML.video_title[i]).length); } }
output gives like:
22 43 54
[code].....
I could push these numbers into array and then sort that array numeric to get the highest number, but is there an even shorter way to return the highest number from these strings?
I am totally new to AS3.0 and OOP in general, so this is a very basic question I can't seem to figure out.I have a package.Inside that package is a class.
Inside that class is a function that initializes a timer called setTimer()
I am trying to run setTimer() when the program starts, but it seems that wherever I put the line setTimer(); in the program, I get an error.How and where can I run this function just once when the program starts, so I can initialize my timer?
I am totally new to AS3.0 and OOP in general, so this is a very basic question I can't seem to figure out. I have a package. Inside that package is a class. Inside that class is a function that initializes a timer called setTimer() I am trying to run setTimer() when the program starts, but it seems that wherever I put the line setTimer(); in the program, I get an error. How and where can I run this function just once when the program starts, so I can initialize my timer?
I'm having some troubles with the use of interface and inheritance in AS3. I've done lots of OOP in the past and what I'm trying to do seems obvious to me, but doesn't work in AS3. The question is : Is it possible to override a function that return an Object of class A, and make it return an Object of Class B which extends A ? It seems not to be possible, since I'm getting a signature error in Flash, when compiling. For example, the following set of class do not compile (the code in function definition doesn't matter):
Im trying to get the Total number of images for each project. But it only returns the first image for each project....Do I need to nest a loop within the project loop to get the images for that project?
[AS] function loadXML(loaded) { if (loaded) { projectNode = this.firstChild;[code]......
I'm using an AMF service that was built by someone else. Basically what happens is that some info is passed to the AMF service and it returns true or false.I want to be able to pass in various info to the a function that calls the AMF service(submitTracking) and then get the true or false value returned in onResultSubmit to be passed back to submitTracking.
var screen:String; var buttonnumber:String; function submitTracking(screen:String, buttonnumber:String) {
I have populated a List component with data from an XML file. I simply want the index of the line clicked returned so I can gotoAndStop to that Frame number. I have found the 'selectedItem' property but I don't want the text, I want the number of the line.
I'm trying to develop a simple as3 flash program that passes a collection a variables and returns a result based on the filtered results of a mysql table. Here is my as3 file:
[Code]...
No value is returned. If I replace with '$test4' and '$test5' with numbers such as 1 and 17, a value is returned. Where am I making a mistake?
I have a question regarding TweenMax and the way it tweens MovieClips. Here is what I have.
1. I have a rectangle movie clip on stage (width:20, height:20). When you click it, it expands (to width:650, height:350) and gets a 3-d function attached so it reacts to mouseXY position (like Lees 3-d photo tutorial). This part works fine.
2. I click it again and it retracts to its original small size (width:20, height:20). This also seems to work fine.
Problem: When I click it again it expands (to width:650, height:350), but when the 3-d function gets added it starts tween all weirdly shape and not the way it is intended.Here is my class
I need the enemies to move around the obstacles on screen. I have tried several methods but it seems to screw up other functions in my game... For example the depth sorting function starts messing up (sortchildren()). I think its because i'm such an amateur.
I've got a site that is using loadSound to play some mp3s and it works fine. however, the sound starts to stream, and then replays itself like a second later. my guess is that its playing faster than the load is going and when it gets to the point where it hasn't loaded enough, it starts to replay it, but i'm not sure that that is the exact problem. my code:
[Code]...
now, i tried making a playTrack function that i can call with setTimeout and i put that in the onLoad in place of track.start(), but that didn't work either (i was hoping to not start playing the track for 3 seconds to give it some time to buffer).