ActionScript 3.0 :: How To Call The Function 5 Times
May 12, 2010i have a function 'a' with array 1x2, 1x3, 1x4...every step its 1x2 > answer1x3 > answer..ans so onif answer correct i call my function 'a' again.
View 2 Repliesi have a function 'a' with array 1x2, 1x3, 1x4...every step its 1x2 > answer1x3 > answer..ans so onif answer correct i call my function 'a' again.
View 2 RepliesIs it possible for me to create a button that must be clicked 4 times within 3 seconds to call a function?
View 3 Repliesi'm not reaching this... so imagine 3 clips on stage (ma0, ma1, ma2)every rollOut it sould delay the call of a function, where it should trace the caller clip, and then clear the interval...
[AS]function out(who:MovieClip):Void
{
trace(who);
clearInterval(intTim);
}
for (var i:Number = 0; i<3; i++)
[Code]...
don't know if i was clear, but it seams to me that i need some sort of way to create diferent "processes" for each clip... for example, if i create differet intervals for each clip and then clear each interval individually i can get this to work... but it's sure not code wise.
camera.addEventListener( ActivityEvent.ACTIVITY, onTriggerRecordStart );
Or do I make sure that the above script is only called once?
UPDATE
Can I register two different functions to the same event?
I'm trying to use ExternalInterface.Call to call a JavaScript function to launch a lightbox window. So far I have this:
AS3:
flash.external.ExternalInterface.call("launchLB", "" + aUrl + "");
JavaScript:
function launchLB(url) {
alert(url);
[Code]....
I get the alert but I can't get the lightbox window to display. When my as code makes the ExternalInterface call I get what looks like a page refresh and a blank browser window.
I have an enterFrame action that I use on a graphic:
[Code]....
Because I want to use the above code more than a few times, I tried to make it a function.
[Code]....
But for some reason the function call does not work when I call it via an action on a graphic where initially the code worked when it was explicitly written and not called as a function.
Code:
onClipEvent (enterFrame) {
fadeOut();
}
why this is not working.I have an application with a new class I just created. The class loads, but will not call it's own internal function.
package com.parkerandkent.components.classic.photogallery {
import caurina.transitions.Tweener;
import flash.display.MovieClip;[code]....
"Test 2" will not fire here.And I get this error message:
CallTag.as , Line 10 1180: Call to a possibly undefined method init.
I need to get a javascript var in my Flash application. I like to be able to just set a variable in the javascript (client constraints) rather than define a function.
Can this be done? I am trying to use the ExternalInterface.call()
AS:
ExternalInterface.call("function(){return window.someVar}", null);
JS:
var someVar = "Test";
This does not work and I suspect it is because the ExternalInterface.call() does not like the anonymous function.
I have a function defined in JavaScript like so:
function fadeBack() {
alert("fadeBack called");
};
I call that function from my Flash file like so:
import flash.external.*;
flash.external.ExternalInterface.call("fadeBack");
This works in both Safari and Chrome, but for some reason Firefox won't ever call the function. Still, I can't figure this out. How can I fix it?
Does anyone know if there is a way to call a dispatchEvent call from inside of a static function?
View 2 RepliesI want to use a function for several times in a script(for several button)
View 6 Replieshave a node that has an asfunction embedded - won't work. if I change the a href to a web page- it works fine. If I try to call a custom function it doesn't call it at all.
View 1 RepliesI'm talking about the div(X,Y) function in C which returns the number of times X is reduced by Y. if you're confused, I'm talking about this:
div(30,5) returns 6 (30 is reduced 6 times by 5)
div(34,7) returns 4 (you can reduce 30 by 7 four times, leaving 6 behind)
Is there such a function?
I am trying to repeat a function x number of times. How do I go about doing that?
Here is the function:
Code:
function dance(){
var animspeed = .4;
var back = 0;
var delay = (animspeed);
[Code]...
I have a function in Flex which has three function in it.
public function update():void
{
A(); \Dispatches a event with Remote Call
[code].......
I've loaded text from database and I make links for each title, works good, until I try to add a item counter to have a next and previous button, allowing user to load 12 records.when inserting the next code, my links fire n times, not just once as expected, making browser to unespectly quit.what can be the reason?
some explanation
init is the number I need to increase or decrease to make database query
total is the number of received records by query
total_geral is the number of all records in database, so I can know if I must or not have a next button
t is the name of the mysql table where query should happen
code:
Contadores
function contagem(init:Number, total:Number, total_geral:Number, t:String):void {
var contador;[code]...
how can i make a function example() be repeated 5 times with a delay of 3 seconds in between?
View 8 RepliesI am trying to make a simple mp3 player using flash. The songs are loaded using an XML file which contains the song list. The following code is inserted into a new keyframe.
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.*;
import flash.events.MouseEvent;
[code]...
The problem over here is in the nextSong() function. I am unable to preserve the value of currentIndex. Although I am incrementing currentIndex every time the function is called, but the value remains unchanged.
is it possible to write a function to move an object and then call that function on a clip event for instance
function (bounce){
script;
script;
}
and then call it by saying
on(mouseOver){
this.bounce;
}
is it possible to store a list of params needed for a function in an array and then use that in a funciton call?
[Code]...
or something like that?? Prob have to iterate the array but how do i get the params into the function call? Is this even possible?
How create baseurl function in flash and how i call that function in button script
View 1 RepliesI have this code but I cannot work out how to fill in function parameters based on an array and it's length, see line 7
[AS]
import com.robertpenner.easing.Cubic;
MovieClip.prototype.framesTimeout = function(func:Function, frames:Number, args:Array) {
[code]....
Is it possible to call a function and fill in the parameters based on an array and it's length?
I have an AS3 program that calls a function multiple times. The function must return multiple variables, so I created a class for the function to declare an object containing all of these variables. For example, here's my class:
package
{
public class PER
{
[Code].....
Let's say the calling program calls the function, which returns the variables into data_set1 (where data_set1 depends on input variables arg1, arg2, arg3) using:
var data_set1:PER = function_name(arg1, arg2, arg3);
The calling program does some stuff, then calls the function again, but returns the variables into a new variable name, data_set2:
var data_set2:PER = function_name(arg4, arg5, arg6);
My intention is that data_set1 and data_set2 are different (e.g. not linked together).
My question is, given that arrays are passed by reference, will data_set1 be modified to agree with data_set2 upon the 2nd function call? Why or why not?
I'm using this code to call a actionscript 3 function through javascript
[URL}
and I want to call the acrionscript 3 function from a javascript function, but not on a button action.
actionscript code:
//call to javascript
ExternalInterface.call("sendToJavaScript");
//call from javascript
[Code]....
this is the function i want to turn in to a static function. just dont know how to make it a static function and call it from other classes. i think this would have its own file.
[Code]....
var speed:int = 4;
addEventListener(Event.ENTER_FRAME,MoveRight);
function MoveRight(event:Event):void{
[code]......
I have a flash piece that I want to loop 3 times and then stop.
View 2 RepliesHow could i call the same function within a function AND when listening for an event?
would something likt this:
[Code]...
I have taken variable in one function and want to use that value in another function.
View 2 Replieslet's say I have 3 functions like this.
ActionScript Code:
function function1(e:event):void{
//code
[Code]....
Can I somehow, stop the enter frame in function 2 with some code in function3? I know that is not the better practice, but in this case is really needful to have a function inside another.