I would like to add a code that would add an initial call to the function myFunction, but because it is listening for a MouseEvent, it has to wait until a MouseEvent happens (CLICK)
I thought that I could add a parameter to a function call like this:
Code:
myFunction(e:Event, buttons[0]);
but that did not work.
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.
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()
have 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.
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?
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.
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.
I have made a simply condition calling a constructor of a class. Today I had to add an "else if", what caused the compilator to show me "A function call on a non-function was attempted."...
Code: function loadIt() { if (var1 == "1") {[code]....
I have this class where I have a dynamic function name, but I don't understand how to call it, I'm getting all kinds or errors, but most the Incompatible Override and Duplicate function definition.Here's the class:
Say I have 20 buttons, each calls a function to draw a square on the screen in a different place. So we'll call those 20 functions square1, square2, etc. Now say I also have 1 more button called all, and if I click that button I want all 20 of the square functions to execute. I've tried the following and I get errors.
function allSquares(e:MouseEvent):void { square1(); square2();
I have a function called processXML on the timeline (yes, I know now...) which does what I want it to do e.g. it loads XML, is passed into several arrays and manipulates things on screen. Cool I have another function, a TIMER, from which I'd like to call the function above e.g. processXML.call() (I want it to load fresh data every 10-20 seconds) But no luck. I'm new to AS3 but can't seem to get it working.