ActionScript 2.0 :: Call Function From A Loaded Movie?
Nov 23, 2010
I've been working on this extremely annoying problem for over 3 hours!
Alright the basics: A parent movie, and a loaded movie.
Inside the parent movie on a frame where the loaded movie is loaded, are two functions[code]...
I have multiple functions and multiple ways to call them because I'm trying atleast for ONE of them to work! I have twisted this code, changed the functions, and tried so many different ways to debug this problem! And finally, I am showing you my most simplified way of testing this problem.
Normally, when I load my parent movie and once it loads the loaded movie inside it, if I click the button- it should call one of my functions. Then I should see the traced message in my output. Instead- nothing happens.
View 4 Replies
Similar Posts:
Feb 4, 2009
[code]...
these are a couple of functions within a custom class i'm working on. why in the top function that when i call init() on the loaded swf, it works, but when i call reverseType() and normalType() in the second function, it doesn't work? i get a "TypeError: Error #1006: normalType is not a function." in the debugger. i've made sure those two functions are public in the document class, but nothing seems to work.
View 1 Replies
Aug 18, 2010
I have a swf called index it has the following [code]...
it traces the "why cant i see the loadswf function" How can I get it to call the loadswf
View 1 Replies
Feb 24, 2011
I have a swf that loads in another swf, in the swf that loads in I have a button that I want to call a function in the swf that loaded it in.
View 4 Replies
Apr 30, 2010
Can anyone tell me if its possible to call a function or class from within a loaded MC?
mainMovie loads MC > MC calls function in a class of mainMovie
if so, what is the best method?[code]...
View 2 Replies
Jan 7, 2005
is it possible to call a function in an externally loaded swf from _level0 ?I have "mySwf" with "myFunction" in it. I have "myMovie" which loads "mySwf" can I call this.mySwf.myFunction(); It dosn't seem to work for me...
View 3 Replies
Jan 7, 2005
is it possible to call a function in an externally loaded swf from _level0? [code]It dosn't seem to work for me..
View 3 Replies
Nov 10, 2009
I have a swf that should be able to load another swf in runtime. Then I would like the loaded swf to call a method of the parent, loader swf, like this:
Code:
parent.closeForm;
But when I compile it, it throws this error:
1119: Access of possibly undefined property closeForm through a reference with static type flash.displayisplayObjectContainer.
I've tried:
Code:
if (parent != stage){
parent.closeForm;
}
So flash won't run this code at compile time, but it always throws that error. Here is the code of the LOADER swf:
Code:
private function loadForm():void {
var loader:Loader = new Loader()
var mRequest:URLRequest = new URLRequest(formPath);
loader.load(mRequest);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onFormCompleteHandler);
[Code] .....
How could I write an expression that should call a function of the LOADER swf without having this compile-time error?
View 14 Replies
Jul 18, 2010
I'm trying to make a loaded SWF call a function that is in the parent SWF, but it is not working.In AS 2.0 I could just put something like _root.myFunction(); and it worked.But in AS 3.0 it does not work anymore.
View 3 Replies
May 13, 2011
Does anyone know the best method to trigger a function in the root from a dynamically loaded movieclip (loaded using addchild) using AS3, I understand targeting root is not the best way to do this?
View 2 Replies
Jul 15, 2010
I have small issue in as3. I am load "mainmenu.swf" file into "main.swf". through loader class. so now "main.swf" is parent "mainmenu.swf" file children how can call "main.swf " variable & function from "mainmenu.swf" .
View 2 Replies
Apr 3, 2008
I'm loading in a .swf file using loadMovie(), but the .swf being loaded has a fscommand("fullscreen", true); command on it's first frame and it's forcing my main file to launch fullscreen too.
I don't have the original file so I can't remove the fullscreen command.
View 7 Replies
Feb 10, 2011
I want to display a Flash video in a popup window, and when the video has finished playing, close the window using a javascript function "closeIt":
<script>
function closeIt() {
alert("About to close...");
[code]....
How can I achieve this? I have imported a video into Flash (choosing "load external video with playback component"). This is in frame1. I thought that in the second frame I could make a call to ExternalInterface.call("closeIt") in the Actions window. I have tried this, but when I publish and view the flash movie in a web brower, I never see the javascript alert.
View 3 Replies
Jun 28, 2011
I'm trying to use a movie clip's function from a fellow movie clip 2 children up and I can't find the right code. I've used:
MovieClip(datalist.getChildByName("content")).onpauseButton();
MovieClip(datalist.root.root.root).onpauseButton();
MovieClip(datalist.scrollb.content).onpauseButton();
MovieClip.(datalist.onpauseButton);
and none of them work. The function is "onpauseButton" and it is inside of "content" which is inside of "scrollb" which is inside of "datalist." I'm trying to call it from datalist's neighboring movie clip so that it activates along with another function:
manualButton.addEventListener(MouseEvent.CLICK, fl_ClickToLoadFile_1);
function fl_ClickToLoadFile_1(event:MouseEvent):void{ navigateToURL(new URLRequest("M-23 6263.pdf"), "_blank");// want to add the onpauseButton code here
}
I recall that there is a way to do it, I just can't find the right sequence. Everything online is about how to call up to a function outside of the movie clip and not down to a function inside of one.
View 4 Replies
Aug 1, 2006
Does anyone one know if it is possible to call a function from a different movie clip than the one it is in. For example, a function named loadData() which is on the first frame of a movie clip instance named thumbNail which is on level 0 on the stage i was thinking that it should work to call the function from frame one on the stage with..
View 5 Replies
Apr 2, 2009
I just need to call a variable or function from a movie clip to main timeline. In AS2 I would use something like:
_root.myvar = "Hola";
or
_parent.myfunc(4,2);
But this doesn't works on AC3. I tried to remove the "_" but its the same.
View 2 Replies
Apr 23, 2010
I actually don't need help, i just want to know your opinion about that weird Flash CS4 (AS3) behavior.there should be something i missed.
1) what happens: flash movie plays on any (even non-existent) function call between if(bytesLoaded==bytesTotal), and doesnot play on commented-out or blank line there
2) what should be seen instead: no action - i dont call any timeline functions so the movie shouldn't be playing.any warning or error? i dont know, flash is so *-nixy all the time in the way it handles errors.
3) where: in the.if(stage.loaderInfo.bytesLoaded==stage.loaderInfo.bytesTotal)[code]
View 2 Replies
Feb 6, 2011
i am aiming to display an alert when the user hovers over the form in fullscreen mode only. When the user is in normal view nothing appears. I have listed the code i am using but nothing seems to happen.
Code:
onLoad = function() {
displayAlert();
}
[Code].....
View 5 Replies
Jul 21, 2011
in my flash, I have an interface which loads pictures through button clicks. During the "loading stage" of every picture, a preloader animation is displayed.Currently, after the swf starts, the first picture is loaded without said preloader animation. I wish to call the preloader function (see code example below) ONCE during startup of the swf, with the first picture load.
loadMovie("load/beach.jpg", _root.content_mc);
// image 1 loads the beach image using startPreload
image1_btn.onPress = function(){
[code]....
View 3 Replies
Oct 16, 2005
Suppose I have three different movie clips. mc_A, mc_B, mc_C I want to have a rollover call a function that changes each movie clip. But I don't want to type it out like this:
Code:
mc_A.onRollOver = function() {
Explode.newExplosion(mc_A);
};
mc_B.onRollOver = function() {
[Code]...
Above you will see that I used this, it made sense to me, but this always refers to the main timeline (root in my case). So how do I pass the name of hte clip I am rolling over to a function?
View 8 Replies
Jul 23, 2007
I'm having an issue with a simple movieclip onRollOver event. Here's my code:
Code:
_root.mc_shutternav.mc_nav_8.onRollOver = over;
_root.mc_shutternav.mc_nav_8.onRollOut = out;
_root.mc_shutternav.mc_nav_8.onRelease = hit;
[code]....
However, with this setup the function hit() is called automatically every time I publish the movie. What's wrong with this? What's the difference between mc.onRelease = function; and mc.onRelease = function()?
View 1 Replies
Feb 23, 2009
I have a child movie clip attached to the parent via the flash interface. The child is running a timer via code on its (the child's) timeline. When the timer finishes it needs to trigger a function on the parent's timeline. All the examples show how to trigger a function on the child - that is easy and I have got that working.
View 1 Replies
Mar 23, 2010
I have website I am developing and I have an intro SWF that I have placed the following AS 3.0 code in the last frame to call the Jquery function "trigger" ; or I might be able to detect the end of the movie and then fire the function.
PHP Code:
import flash.external.ExternalInterface;ExternalInterface.call("trigger")trace ("the movieEnded");stop();
Here is the function in Jquery in my HTML page.
[Code].....
View 6 Replies
Oct 6, 2009
Call the load function on a loader two movie clips down?
View 1 Replies
Jul 10, 2011
Here is the code to call function using event listener:
var listListener:Object = new Object();
istListener.change = function() { changeImage(); }
thelist.addEventListener("change", listListener);
[code]......
View 1 Replies
Jul 1, 2004
I have a function at frame 1 (_root). Well, i am trying to call this function from a button, inside a movie clip, but it's not successful..
View 2 Replies
Sep 15, 2011
i have a movie clip with an actions layer can i call a function from an actionscript file from the actions panel?
View 6 Replies
Jan 25, 2009
I have an interface that contains audio controls in the Library (class: AudioControls)When a movie is loaded into the interface, and it happens to contain a sound (class: Audio_1), this loaded movie calls an interface function to show the audio controls:
Code:
if (Interface._ui != null) {
Interface._ui.playCurrentAudio();
}
The problem is, the playCurrentAudio() func in the interface contains some code that refers to nested MCs:
Code:
public function showAudioControls():void {
audioControls.x = 710;
audioControls.y = 583;
//
[code]....
That would be the speaker, rewind_btn, playPause_btn, etc. Referring to the parent clip, "audioControls", is no problem of course. But I get an error when I publish the loaded movie:
1119: Access of possibly undefined property speaker through a reference with static type AudioControls.
1119: Access of possibly undefined property rewind_btn through a reference with static type AudioControls.
1119: Access of possibly undefined property playPause_btn through a reference with static type AudioControls.
View 1 Replies
Jun 22, 2009
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.
View 1 Replies
Jan 7, 2008
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();
}
View 3 Replies