ActionScript 2.0 :: Calling A Function Inside Of A Loaded SWF?

Aug 27, 2009

I'm using loadMovie to load in an external SWF file. I'm looking to call a function called setText() inside of this swf. I can get to the function by doing this:

ActionScript Code:
toolTip = _root.createEmptyMovieClip("toolTip", _root.getNextHighestDepth());
toolTip.loadMovie("ToolTip.swf");

[code]....

but it's not working like this:

ActionScript Code:
toolTip = _root.createEmptyMovieClip("toolTip", _root.getNextHighestDepth());
toolTip.loadMovie("ToolTip.swf");
toolTip.setText(aTxt);

how I can do this without an enterframe?

View 3 Replies


Similar Posts:


Flash :: Calling OnLoadProgress Function From Inside Another Function?

Sep 23, 2011

I have an AS3 function that loads and audio file and then plays it. I have the pre-loader for the first audio file working - now I need to run the pre-load function before the 2nd audio file starts.

myMusic.addEventListener(ProgressEvent.PROGRESS, onLoadProgress2, false,0, true);
myMusic.addEventListener(Event.COMPLETE, playMusicNow, false, 0,true);
myMusic.load(soundFile, myContext); //This code works

[code].....

View 2 Replies

ActionScript 3.0 :: Calling A Function That's Inside Another Function?

Dec 8, 2009

function test1():void
{
function test2():void {..}

[code].....

View 6 Replies

ActionScript 2.0 :: Calling Function Inside A Function?

Mar 23, 2010

how can i call a function that is inside another function.like:

Code:
function abc() {function uvw() {
}
function xyz() {[code].....

View 3 Replies

ActionScript 3.0 :: Calling A Function From Inside A MC

Aug 13, 2009

I am using tweenlite throughout my file. I am importing it on the root timeline and would like use it inside a movie clip without having to reimport it. How do I reference it from inside the movie clip? I thought I could do something like this, but it does not seem to work: parent.TweenLite.to(leaf1, 1, {alpha:0, delay:1});

View 15 Replies

ActionScript 3.0 :: Calling A Function Inside Of A Mc?

Aug 7, 2009

theres a function on the main timeline, I want to call it from inside of a movieclip.the first error was that it couldn't find the function and then I found a post where a guy said I should try something like MovieClip(root).fn() which made sense but then I got the "cannot convert stage to movieclip" error.

View 1 Replies

ActionScript 3.0 :: Calling A Function Inside Another Class?

Sep 9, 2009

I have the following two classes and can't seem to figure to figure out how to call a function in the top one from the bottom one. The top one get instantiated on the root timeline. The bottom one gets instantiated from the top one. How do I call functions between the classes. Also, what if I had another call instantiated in top one and wanted to call a function in the bottom class from the second class?

package
{
import flash.display.MovieClip;

[code]......

View 12 Replies

ActionScript 3.0 :: Calling A Function Outside A Movieclip From Inside One

Sep 16, 2007

I have a function I made in the root timeline. Inside of a movie clip, I have a button which calls the function in the actions layer in the root timelime.. how do I make this work?

[Code]...

View 5 Replies

ActionScript 3.0 :: Calling Javascript Function From SWF Inside Another SWF

Apr 30, 2010

I have a SWF that is used to load other swf to it.

each of the loaded swf files has its own button events that try to access javascript functions. The problem is that they can't access the javascript. It never gets to call the functions.

If i run those swf on their own then it works..

what should i do do have embedded swfs to call javascript methods ?

View 1 Replies

ActionScript 2.0 :: Calling A Function Inside A Flash Movie Via JS?

Aug 7, 2007

I need to call a function inside a Flash Movie via JS (to update a textfield and sum Vars) can someone point me in the right direction???I tried to figure out the external interface api, but i dont understand how it really works ... For example: JS calls function "Fieldupdate" and in the Flash Movie the Fields and Vars Updates

View 2 Replies

ActionScript 3.0 :: Calling A Function In A Loaded Swf?

Aug 1, 2009

I'm using FLex Builder and in my Main class I load an external swf. In the external swf there is a movieclip on the stage called house. In the library I have that movieclips Class name set to a class I defined called com.buildings.House

When I load the swf from the main class I'm trying to access a function called setup in the class called House. I have tried a bunch of different ways but I get errors for them all.

Code:
private function onLoadSwf( url : String) : void
{
var loader : Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoadComplete);
loader.contentLoaderInfo.addEventListener(Event.INIT, onLoadInit);

[Code]....

I'm at a loss right now and its driving me mad. In flash I used to use the var externalSwf : MovieClip = evt.target.content; example and it worked but with Flex Builder its throwing error saying setup is not a function.

With the Imap interface its saying externalSwf is null.

View 6 Replies

ActionScript 2.0 :: Calling Function From Loaded SWF

May 10, 2008

I have a movie (let's call it index.swf) that has a movie clip loader which is loading external .swfs Is there any way that I can call a function that is on the index.swf's main timeline from one of the externally loaded .swfs? Basically all I want to do is to be able to play another mc that is on the index.swf's main time line by pressing a button that is on one of the external swfs.

View 3 Replies

ActionScript 2.0 :: Calling Function Located On A Frame Number Inside A MC

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

ActionScript 3.0 :: Calling A Function Inside A Class From The Main Timeline

Aug 12, 2009

i am getting a "ReferenceError: Error #1069: Property beginTargetLock not found on AimCursor and there is no default value."

[Code].....

View 2 Replies

ActionScript 3.0 :: Calling A Function From A Contained/loaded Swf?

Mar 2, 2010

Have a swf that I am making (call it "contents") that gets loaded into another swf (call it "container") [pre-existing from someone else].How do I, from inside the Contents file I am making, address and execute a function from the Container movie?I know how to go from the container to the content file, but don't know the syntax the other way.Thought something like this should work but doesn't seem to:

Code:
if(this.parent.parent!= null){
var parentLevel:Object = this.parent.parent as Object;

[code].....

View 1 Replies

Actionscript 3 :: Calling Function In A Runtime Loaded Swf?

Dec 11, 2010

My problem specifically I am designing a user interface with controls on it. 5 buttons rotate left, rotate right, zoom in, zoom out, and auto rotate. The interface in itself works fine, I can trace out button clicks, toggle the auto rotate button etc...

My program reads an xml file. Loads some images, fills an array with links for each image, and when the image is clicked a loader loads a swf from a URL and displays it on screen. No problem.

Now I originally had the zoom controls user interface in the runtime_loaded.fla library, and the mouse listeners in the same linked document class. The interface works with the movieClip in runtime_loaded.swf when it is in the same code.

[Code]...

View 1 Replies

Actionscript 3.0 :: Calling A Function In A Loaded SWF From A Parent SWF?

Jan 21, 2009

syntax for calling a function (and sending arguments) located in an external SWF from a parent SWF?

View 2 Replies

ActionScript 2.0 :: Calling A Function On A Loaded Clip?

Jun 16, 2006

So I can load in a movieclip fine, using MovieClipLoader. What I don't understand is how to access variables in the loaded clip, or, more importantly, how to call a function on the loaded clip.

Here's what I have as a test:

Code:
var game_mc = _root.createEmptyMovieClip("game_mc", 0);
loader = new MovieClipLoader();
loader.addListener(this);

[Code].....

View 2 Replies

ActionScript 3.0 :: Loaded SWF Calling Main Timeline Function

Aug 5, 2009

I have a project which requires the loading and unloading of multiple "scenes". All my navigation is working (probably not the most efficient way) but I'm having one issue. I need a button on one of the loaded SWFs to call a function on the main timeline. Since Actionscript 3 no longer supports the _root functionality the way AS2 did, I cannot access the main timeline.

In general, how do I get to the root of the main timeline without using _root?

Also, how can I reference the loaded SWF and objects inside of it from the main timeline?

View 1 Replies

ActionScript 3.0 :: Calling Function From Externally Loaded SWF Into Main SWF?

Apr 4, 2009

I've written a script that takes keyboard input to turn movieclips on and off in a swf file (like the visible/invisible layer function in photoshop). Then I'm attempting to load the *.swf (image.swf) into a zoom/pan flash file from flash den. When I load it in, the keyboard controls no longer work. I've tried importing the keyboard control function (keyDownListener) into the main zoom.fla with this script:

Code:
import flash.display.Loader;
import flash.net.URLRequest;

[code].....

View 2 Replies

ActionScript 3.0 :: Calling A Function From An Extended Class Inside A Top Level Class

Sep 23, 2009

package{
public class Character{
protected var _hp:uint = 50; //Character Health Points
protected var _power:uint = 5; //Damage dealt

[Code].....

I`m instancing a Character and a Player in the Main Timeline, all in frame 1.
When I use: ""player.attack(character)"" it works fine by itself.

So I added the if (defender._hp <= 0) this.win() which gives me the following error:

1061: Call to a possibly undefined method win through a reference with static type Character.

"defender" is a Character instance, "this" is a Player instance and "win()" is a Player method. I try to call the Player method inside a Character method using the Player instance adding the "." and his method name

Do I really need to define the win() function in the Character class? Is there a bypass to use a subclass method in a parent class method if it`s called from an instance of the subclass?

View 6 Replies

Actionscript 3 :: Access A Function Inside A Loaded .swf File?

Sep 22, 2010

Is there a way to call a function inside a loaded SWF file?

Basically, I have a .swf file (A) that loads another .swf file (B)...I would just like to treat B as if it was any other instance added to my class .swf "A"...

Have to recast "Loader" with the name of your .swf file class:

Loaded .swf class:

package src {
import flash.display.MovieClip;
public class LoadedSWF extends MovieClip {

[Code]....

View 2 Replies

ActionScript 2.0 :: Use LoadMovie Function Inside Loop To Load External PNG Files / When Game Is Loaded

Jan 19, 2009

I'm trying to use a loadMovie function inside a loop to load external PNG files when my game is loaded. Unfortunately, I can't get even a single loadMovie to work correctly, much less execute a bunch of them.The code is on the root time line, and is targetting an empty movie clip that is nested inside about 3 levels. There is a button, with a movie clip on it, and the empty clip I'm trying to load into on that.so the full target path is myBox_00.smallBox.myLogo(myBox_00 is the button, smallBox is the movie clip, and myLogo is the empty)[code].I even tried using a JPG image instead of a PNG and still no luck. The best I could do was number 4; and that didn't work, all it did was SOMETHING instead of NOTHING... unfortunately that something was to make the button (myBox_00) disappear entirely T_T.I've never had much luck with loading external images. What am I missing here?

View 9 Replies

ActionScript 3.0 :: Calling A Function From A Private Static Function?

Feb 26, 2010

i'm trying to modify some code and can't figure out what the issue i'm having it. this is the(shortened) code:

public static function Lose():void {
trace("OVER!");
Clock.stop();[code]...

this is the error i get: 1180: Call to a possibly undefined method OverIt.i just want to call a function from inside of the public static funtion.both function are inside this class:

public class Game extends MovieClip {
}

View 4 Replies

ActionScript 2.0 :: OOP In Flash: Calling A Function W/in A Function Class?

May 12, 2004

Okay so I am reading through sens tutorial on OOP and updating my game that I am making. It is much easier to code this way (IMO) but still hitting snags.I am trying to get through this code:

[Code]...

View 3 Replies

ActionScript 3.0 :: Stop Inside Frame Not Working When Loaded Inside SWf

Mar 1, 2011

I have a flash code where i am loading an AS 2 SWF inside AS 3. The thing is if i put the AS 2 SWF on same domain its working fine but if i put AS 2 SWF on different domain it loads the SWF properly but the "stop()" written inside the AS 2 frame doesnt work... and it keeps on playing all the frames continuously...

[Code]...

View 9 Replies

ActionScript 2.0 :: Calling A Function W/in A Function Class?

May 12, 2004

Okay so I am reading through sens tutorial on OOP and updating my game that I am making. It is much easier to code this way (IMO) but still hitting snags. I am trying to get through this code:

[Code]...

View 3 Replies

ActionScript 3.0 :: Calling An .swf Inside An Other .swf?

Dec 16, 2009

I have a problem calling an .swf inside an other .swf. This is what i have:I have 3 files organized like2) pruebaLivestream.swf3) pruebaLivestream2.swfIn the file 2 i call functions from livestreamPlayer.as and when i play this .swf it works perflectly.When i call the file 2 in file 3 it gives me this output:TypeError: Error #1009: Cannot access a property or method os a null object reference.

at com.livestream::LivestreamPlayer()
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()

[code].....

View 0 Replies

ActionScript 2.0 :: CS3 A Function Calling A Function In A Function?

Oct 9, 2010

I'm trying to get this one function to be able to call many functions (not at once, but call many possible ones)In other words, I'm trying to get this variable to be named as a function. That way, this one variable can create multiple functions.example:

actionscript Code:
class Thing extends MovieClip{  var funcvar;  var othervar; function onLoad()  funcvar = "YYY";  othervar = "ZZZ"; function onEnterFrame()

[code].....

View 1 Replies

ActionScript 2.0 :: Adding Properties And Events To MovieClips Inside A Loop Inside A Function

Dec 8, 2009

I have done this same thing in ActionScript 3, but am not familiar with ActionScript 2, which I am forced to use for this project. I am loading products into a SWF via XML and attempting to add a click event to each dynamically-created movieclip. Simply tracing the text from a node in XML will do for now. I'd like to assign a property called "desc" or "description" to each movieclip and have it trace that property's value when clicked. Here is the relevant portion of my code as it stands:

ActionScript Code:
var iXML:XML = new XML();
iXML.ignoreWhite = true;

[Code].....

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved