ActionScript 2.0 :: Accessing Function Located In The Loading Movie?
Aug 19, 2007
I have a function to resize my stage which is located in the main movie. There is another movie which is loaded into the main movie and I want the loading movie to call the resize function which is located into the main movie. In short how can I access functions which are located on the main loading movie.
I have treid _level0.resize(); // Doesn't work
_level.parent.resize(); // Doesn't work
But at the same time there is a text field which I can easily update throught the loaded movie by
_level.my_text.text = "Anything"; // Does work
View 3 Replies
Similar Posts:
Oct 24, 2008
This is not web-based. It is a projector file running locally off my my hard drive and connecting to files on another server on my network.
I'm trying to link to this file through the following code:
loader.load(new URLRequest((path == null) ?
"file:///10.10.100.255/my_file.xml" : path));
(obviously that IP is not real)
but it can't see it. However, it works fine connecting locally.
Does URLRequest not work for finding files on another server?
View 1 Replies
Sep 17, 2009
is there a way to keep a movie being loaded externally from playing while it's loading?
here is the scenario:
i have an external SWF being loaded
var ldr:Loader = new Loader();var url:String="movie.swf";var urlReq:URLRequest=new URLRequest(url);
ldr.load(urlReq);
addChildAt(ldr,0);
it is a rather large SWF and i don't want it to start playing before the whole thing has loaded and i don't want to hardcode a stop() function into the externally loading SWF (i'd like to do it in the clip it is loaded into).
i tried:
ldr.content.stop
ldr.content.stop()
ldr.contentLoaderInfo.content.stop()
nothing seems to work
View 3 Replies
Jun 24, 2011
I'm an AS3 noob who is trying trying to get more comfortable with passing arguments into functions.why when the following code is all in one AS3 file as seen below it works and draws the purple square...
package{
import flash.display.*;
public class Main extends Sprite{[code]............
Flash CS5 gives me an error message 1137 saying that it was expecting only 1 argument in the code line --> Fill(square_commands, square_coord);I need to pass the arguments square_commands and square_coord into the function in the second AS3 file?
View 2 Replies
Sep 3, 2008
I have a movie clip on the stage which contains 4 frames and i wanna call a function from for example frame number 4... Obviously i wanna call this function from the main timeline containing all the MC. How can i do that, i have been looking around but cannot find much...
View 3 Replies
Apr 27, 2011
Is it possible to load an mp4 movie into a flash swf, with the mp4 been located on the client pc, and the swf loaded from a server in a html page?
View 1 Replies
Feb 25, 2003
How can I load/unload a movie located on the main scene, from a movie clip, or vice versa. Right now I can only load/unload a movie if located in the same timeline.
View 2 Replies
Nov 21, 2009
I'm not sure that I'm on the right track here. I've got what is essentially a 'gateway' movieclip and depending on the CLICK a corresponding movieclip (form) is loaded -- these all being in their own AS file. There are multiple corresponding pages that will all load/close in their own fashion but the 'gateway' will reload in it's own function-- consequently, I have this function on the main_AS. Can I trigger this function from the sub class or do I need to move the 'reload' function to a 'reload' class.
View 2 Replies
Oct 22, 2011
I am trying to access a function in a loaded swf that has external class.. I would like to avoid having to put the function on my "Main" Doc class in the external swf and instead access the function directly from the class
This is what ive tried so far and it's a no dice:
private function startLoad(){
var loader:Loader = new Loader();
var req:URLRequest = new URLRequest("one.swf");
[Code]....
View 1 Replies
Aug 11, 2010
Is it possible to set a listener or something like it to run a function once the flash movie itself has finished loading?So something like:When this flash movie has finished loading, activate function.Btw. I'm not trying to do this with a swf file loaded into another flash movie. I need this to be done by the movie once it self has finished loading.
View 1 Replies
Sep 23, 2009
i am trying to do a survey and i have 3 buttons, each one represent an answer each button is a movie and i am wondering how to call a movie from my library to a empty movie clip called container when onRelease is used
[Code]....
View 6 Replies
May 2, 2009
why can i access the first function in a class with
PHP Code:
import test.test
var test:test = new test();
but I cannot access the second or third function in the same manner? they seem to be seperte entities within the class definition.
can access
PHP Code:
public class NetStreamex {
public var connection:NetConnections = new NetConnections();
public function NetStreamex():void {
connection.createNetConnection("rtmp://localhost/test/1");
[Code].....
View 9 Replies
Jul 25, 2011
[Code]....
I want to use the variable var_page3_title for dynamic text boxes in movie clips further on down the timeline. Of course I don't want to repeat this code for every textbox so my question is, how to I access the variables from the function loading();
View 2 Replies
Mar 27, 2011
In my SWF, I have a function that automatically runs at a certain time.The user must not run that function or change a timer variable, so is he able to do it with some work ?
View 2 Replies
Jun 23, 2010
I need to access the contents of a variable that is filled inside a function, but is declared outside the function.. [URL] says that if you declare the variable outside of the function the variable should be accessible even when its content is filled by a function. I have declared the imgs variable at the start, outside the function, as an array. After that the function retrieves a string from the URLLoader and splits that string into to the imgs array/variable.
[Code]....
View 2 Replies
Jul 25, 2011
I have this code on the main timeline:
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, loading);
[Code].....
I want to use the variable var_page3_title for dynamic text boxes in movie clips further on down the timeline. Of course I don't want to repeat this code for every textbox so my question is, how to I access the variables from the function loading();
View 5 Replies
Dec 24, 2009
I have a combo box defined inside a function and want to access it from a function that is called on the OnChange event of the combo box.combo1.addEventListener(Event.CHANGE, chkAnswer);How do I access combo1 from function chkAnswer? In other words, what is the equivalent of this.value in as3?
View 1 Replies
Apr 28, 2005
I'm trying to access this function from another timeline. This function resides on the root level and I want to access it from a button within an MC on the main timeline. How can I do this?
Code:
vol_onBTN.onRelease = function() {
vol_offBTN._visible = true;
[Code].....
View 1 Replies
Feb 8, 2012
Here is my code in my main timeline:
var loadit = new Loader();
loadit.unload();
loadit.contentLoaderInfo.addEventListener(Event.COMPLETE,mcLoaded);
[Code]....
View 11 Replies
Apr 20, 2010
What are some methods of accessing/loading external SWF's aswell as there variables inside them. I've been using URLrequest and loader methods no luck yet.
View 1 Replies
Aug 23, 2010
OK, it's probably easiest now to explain my problem like this, I am able to write the name of my xml file that needs to be loaded to a dynamic textfield on the stage, however, I don't seem to be able to access it after this and strip the necessary data from it, here's my code:
var tf:TextField = new TextField();
tf.autoSize=TextFieldAutoSize.LEFT;
tf.border=true;
addChild(tf);
[Code]...
So all I want to do now is to be able to achieve the same thing but loading the xml with loadvars as I did before, from my traces it seems there is a scope issue, but I'm not sure why if "c1" can be referenced like it is above..?
View 2 Replies
Nov 17, 2011
I have a .fla file with some code in the actions panel.A bit of code calls a function in a class from the actions panel .The function in the class is run, but I want to be able to call a function in the main actions panel code from the function in that class .The class doesn't extend anything so (parent as MovieClip).function() does not work.
View 7 Replies
Jan 9, 2012
I have a global var
[Code]...
The only problem is it can't "see" myGlobals. I was wondering if someone could tell me why it can't see it! I'm sure it has something to do with scope.
View 3 Replies
May 11, 2010
I created a canvas in a function, and in his function I have a CLICK eventlistener. On the click I want to manipulate what's inside the canvas. Will referencing the canvas using the Dictionary class work?
View 1 Replies
Jul 22, 2010
I have a function in stage and need to call it from a child I do I do it...
// In main stage
var child_mc:mcChild = new mcChild();
addChild(child_mc);
[code].....
View 2 Replies
Aug 10, 2009
I have been playing around with combining flash and PHP/Mysql for some time now, mainly sending one flash variable to a PHP file and then retrieving a result and turning it back into a different flash variable. My problem is i've got to the stage where I need to access these variables from other functions. Now I think I need to find some way of defining them outside of the function, maybe using global vars? Well i'm not gonna pretend I know anything about it. The two functions from which I access my PHP variables is as follows:
ActionScript Code:
function btnDown(event:MouseEvent):void {
var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest("http://localhost/test.php");
[Code]....
So I need a way to access the phpVar1 variable in a totally seperate function
View 6 Replies
Aug 17, 2009
im attempting to keep it as portable as possible so its easier to edit later, and i dont have to go around copying/pasting too much code. - i'll cut to the chase..
On my main timeline, i load all the image-file names, as variables.. using loadvars into thumbnails, which ive given instancenames Loader_1 to Loader_20, inside these thumbnails is the Loader component Thumb_1. Here is the code on the main timeline, to load these variables.
Code:
BigLoader._visible = false;
var my_lv:LoadVars = new LoadVars();
// load variable function
[Code]....
how i could make this more portable without -completely- changing the format its in [so i can still understand it]
View 9 Replies
Sep 30, 2009
ActionScript Code:
function createMaskBox():void {
var maskBox:MovieClip = new MovieClip();
galleryContainer.addChild(maskBox);
}
creates maskBox under the function therefore not accessible form outside of this function from what i understand. Is there a way to create a var WITHIN a function which would exist as if defined outside of it, directly in code?
View 3 Replies
Nov 24, 2009
I have an instructions.as file which is trying to call a function in the document class through a mouse click event listener and am getting a 1009 error.
Here are my to actionscript files:
** this the the instructions.as**
package Elements{
import flash.display.MovieClip;
import flash.events.*;
[Code].....
View 3 Replies
Dec 26, 2009
I want to be able to make my own math-functions, so that I don't have to write the same trivial functions in all my classes. I would like to import a class called something like MathExtended, and then use functions like this:
MathExtended.sign(x)
I have made an example that tries to import a custom class like that:
Code:
/*
This is the main script which my fla. runs.
*/
[Code].....
View 3 Replies