ActionScript 2.0 :: Calling Functions From External SWF'S?
Aug 19, 2007
its a site about interior design. my job is to add some code to do something. i checked the code and his approach is not so good.. he's coding inside objects and frames at the same time. (ive read many actionscript books and this is a really bad practice). Here's the problem... he wants this to be implemented in the site...1.) in the gallery there is a scrolling thumbnails, he wants this to pause about 4 seconds then it will start to scroll..(ive already fixed this by creating a function interval.
Here is where my problem is...2.) When you click the thumbnail, the enlarged view will pop up.. the enalarged view are external swfs... the client wants that when you click on the thumbnail, the scrolling will stop and the external popup enlarged image will come out...this external swf has an exit button to go back to the main gallery window which is another swf... so the client wants that when you hit exit from the external swf popup window, the scrolling will resume.... im having a hard time figuring this out because i dont know how to call a function from an external swf to the main movie (the gallery page) Ill post the fla of main movie, gallery and a single external swf link of the thumbnail. just click on the first picture that will appear on the gallery
View 1 Replies
Similar Posts:
Feb 11, 2010
I am trying to call multiple functions at different times from the same .as file. I asked this question in another forum but the reply did not work. I have 2 as3 books but they both only talk about calling a single function from the external file. Can someone detail the structure in the .as file as well as how to call it from the .fla? I am missing something and I can not figure out what it is
View 3 Replies
May 9, 2010
My needs are to execute a javascript whitout calling any external function of the html file when a flash button is clicked. I need to obtain the effect that happen when the user put in his address bar the text javascript:"alert("Hello World!"); and press enter I need to do this whitout calling any external functions, whitout calling anything in the html file, all just with the swf. Of course the script that i must call is another than javascript:"alert("Hello World!"); but let's begin with this easy script and when working i can thikn to implement the complex one
i tried this
ActionScript Code:
on(release)
{
function runJS(script:String):Void {
[Code]...
but is not working, i get a syntax error, maybe cuse of the " in "Hello World!"
I want to ask if what i need to do is possible and, if yes, why my AS code is not working.
View 4 Replies
Oct 6, 2011
I have a series of calculations i'm doing over a bunch of objects stored in a array. Each function is pretty CPU demanding but if you only run one function, it just works fine.
[Code]...
View 2 Replies
Mar 16, 2003
Is it not possible to call other functions from generic mouse event functions? Surely it is !!??ie....
Code:
_root.myButton.onPress = function(){
hide();
[code]........
View 11 Replies
Aug 20, 2009
If I have a function and I want to call a variable from another function (only 1variable), how do I do it? I know in the olden days you could set the variable to local or global, but that does not seem to work anymore. There is only 1 variable I need access to, but all the tutorials I have come across talk about making classes for multiple variables.
e.g. function2();
{
variable_b = variable_a;
}
[Code].....
View 3 Replies
Feb 12, 2009
I can't get it but, i'm coding in as3 and i can't target a function from a swf file loaded in the DisplayObject loader in any way. I don't want to create a class to make this function works. It's a simple function, made to change a picture every time the user navigates on another swf. Well. The point is, why in the name of God, the as3 cannot target another swf? How can i do it?
View 0 Replies
Aug 7, 2009
I have made an event listener:text0_mc.addEventListener(MouseEvent.CLICK, showMe);showMe is a function, but I need it to call more than 1 function at once i.e. -ext0_mc.addEventListener(MouseEvent.CLICK, showMe1, showMe2, showMe3, showMe4, showMe5, showMe6, showMe7);Each function contains an if statment as below.
function showMe1(event:MouseEvent):void
{
if (shuffledArray[1]==orderArray[1]){
[code].....
View 1 Replies
Feb 23, 2010
Is there any way to call two functions concurrently at the same time in AS3? I have two functions which do very sensitive things, a difference of 0.1 second is considered failure.
View 2 Replies
Jun 17, 2009
I'm having some trouble calling a JavaScript function from the HTML file I've embedded my SWF in.
I'm currently using Flash 8.
I'm trying to to simply call a function which will open an alert window, but when I click my button, nothing happens.
Flash Code:
import flash.external.*;
testbutton.onRelease = function() {
ExternalInterface.call("testAlert", "Yay, it finally worked");
}
[Code].....
View 0 Replies
Nov 8, 2009
why the following does not work:
private function test():void
{
Parse1(textarea1.text);
Parse2(textarea2.text);[code].........
It seems only the first parse function is called and the rest is simply ignored.
View 6 Replies
Apr 29, 2010
I'm loading a flash file using the built in Loader class. How can I call one of the original swf's functions from the loaded swf?I know about LocalConnection and using that with other SWFs on the same webpage, but is there a better way of doing it if you're loading an swf within another? The reason is that I need to get a return value from the function, and local connection's send() only provides a true/false.
View 0 Replies
Feb 7, 2006
PHP Code:
function finale(){ finalFunc = "section" + _root.selectedSection finalFunc();}_root.selectedSection = 1finale();function section1(){trace("moo")}function section2(){}
View 1 Replies
Sep 6, 2006
I have this function that builds menus, and I'm using a tweening class function to move the menu items around. The thing is that when calling the tween function I need the submenu building function to wait until the tween is finished otherwise things start freaking out. It's organized like this (pseudo code):
[Code]...
The problem is that I need the first tweening to finish before I can build the submenu. I've tried using the onMotionFinished, but it doesn't seem to want to call a function nestled into another function (in this case buildMenu()).
View 1 Replies
Jun 5, 2007
while the condition of a if statement is true, as in the following hypothetical example, will it keep executing that code continuously until the condition somehow becomes false?
i.e. - will it keep trying to load the photo into the photo_movieClip instance continuously until the condition is false?
Code:
if (condition == true) {photo_movieClip.loadPhoto(image); //send image from array to load into photo_mc};
[i]...If so, how can i make it call that function only once even if the condition remains true?
View 3 Replies
Jun 16, 2007
I have this REALLY wierd problem. I have a MovieClip that is attached onto the stage. In this MovieClip I have the init() function. When I try and call this function, after the MovieClip has been attached on stage it doesn't work! I can't belive it!
MovieClip Frame 1
function init(){
trace("bleh");
[code].....
View 2 Replies
Nov 20, 2008
I was able to find different threads about random loads: the most are photocontainer, well I also found a text random loader But I can't find some about function random calling: in a site I'm building I have three functions (but other will be added) that when called in callback change general graphic appearance, loading a dozen of different parts in various container with attachMovie; I wish a function that loads them randomly
Actually I'm trying:
//variable "funArr" with the three function names
var funArr:Array = new Array("montaspazio", "montabilancia", "montaaereo");
[Code]...
View 1 Replies
Apr 22, 2010
I am having problems calling functions in a SWF (B.swf) which I load into my first SWF (A.swf).
Nothing seem to happen when I call the functions, values that are supposed to be returned from the function call are undefined.
[Code]....
View 1 Replies
Oct 13, 2003
i'm trying to call a function on a clip, but i want to use a variable that i'm sending to the clip so that when the one function gets done it knows what to do next. i just have no idea of what the syntax would be. here's a sample.
[code]...
View 3 Replies
May 20, 2009
Is it not possible to call more than one function at a time?, this is my problem:-
btn.onRelease = function()
{
blah();
something();
jump();
}
When I run something like the one above, jump is executed but everything else is ignored, would really like to run all functions at the same time.
View 6 Replies
Jun 17, 2009
I'm having some trouble calling a JavaScript function from the HTML file I've embedded my SWF in.I'm currently using Flash 8.I'm trying to to simply call a function which will open an alert window, but when I click my button, nothing happens.
Flash Code:
import flash.external.*;
testbutton.onRelease = function() {
ExternalInterface.call("testAlert", "Yay, it finally worked");
[code]....
View 1 Replies
Feb 9, 2009
I want to loop through a array to call my functions, but can't get the syntax right?
var myArray:Array = ['function1()', 'function2()'];
for (var key:String in myArray){
// I want to call the function here
}
View 1 Replies
Mar 13, 2010
I'm new to writing several different class files.. and trying to make a set of boxes that expand/collapse by mouse click and timer..
I have 4 class files, Box, BoxGroup, BoxTimer, and Main.
I can call the functions in Box class from BoxGroup class, but not the functions in the BoxTimer class. it keeps throwing this error. I don't understand why since i'm using the same method between the other 2 class files...
ReferenceError: Error #1069: Property timer_start not found on
CollapsingBox and there is no default value. at
CollapsingBoxGroup/on_click()
[Code].....
View 4 Replies
Jul 14, 2010
I've used the code below to load swfs into my tileList and set their colors using setData() within each swf. Everything seems to work except "source:e.currentTarget.content". The swfs seem to be mixed up randomly each time it runs. Their colors are set correctly and all the other tilelist info is correct. What have I done wrong with "source:e.currentTarget.content"? I can swap "source:e.currentTarget.content" with "source:myXMLList[loadPosition].source" which gives me the correct swf but then the colors aren't set.
for(var f:int = 0; f<myXMLList.length(); f++){
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event):void{
Object(e.currentTarget.content).setData(myXMLList[loadPosition].param eter[0], myXMLList[loadPosition].parameter[1]);
[Code] .....
View 4 Replies
Apr 22, 2011
I don't understand why within my function, initially the status of stage.scaleMode via a trace() is NO_SCALE, then it becomes SHOW_ALL. The code below is found at three different location in my overall code.
stage.scaleMode = StageScaleMode.NO_SCALE; backgroundPositioning(myStage.stageWidth, myStage.stageHeight); stage.scaleMode = StageScaleMode.SHOW_ALL;
View 8 Replies
Jul 16, 2010
i allready searched abit around here and found the solution to call a fx:script function defined in a mxml from a AS class.
[Code]...
View 7 Replies
Nov 16, 2010
I'd like to have a class that will resolve calls to static functions that don't exist.If you have an object that subclasses the Proxy class, you can override the callProperty() method to catch calls to functions, as properties of that object, that don't exist.How can this be done with static function calls in a class? It cannot be done by making the overridden callProperty() method static. Is there another way?
View 1 Replies
Feb 17, 2011
Even I am programmer I am very, very, new to as3.
Problem: I have define a classA in aA.sp file.
package{
import flash.display.Sprite
.......[code]...........
When test on cs4 (contol>enter) I get following error 1061: Call to a possibly undefined method playVideo through a reference with static type flash.display:Sprite
View 2 Replies
Jan 5, 2009
I am using prototype.js to make AJAX calls. I need to do this in a flash document to replace the contents of a <div> which contain a Flash movie, to be replaced by HTML.
Here's the code on the button:
Code:
on(Release){
[code]....
View 1 Replies
Dec 26, 2010
i want to be able to call the function keyDowns() from my main file on ENTER_FRAME. However, i can't seem to get the syntax/definitions right. here's the function within class Hero:
ActionScript Code:
public function keyDowns(event:KeyboardEvent){
if (event.keyCode == 65){
[Code]....
then in the main file i create an instance of Hero called turret i want to call turret.keyDowns() every frame. i'm trying to use this, but i get an error message "1120: access of undefined property event."
ActionScript Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, turret.keyDowns);
turret.keyDowns(event);
View 4 Replies