If Movie Loaded..... Is There Such A Function?
Hi! I have a "click and find items" game, and when the user clicks on the item, a new .swf movie is loaded to the level above the main movie. There are six items to find, so in the end, there are six new .swf movies on the stage.
Is there a code that will check that all six .swf movies are loaded, and when all six .swf movies are loaded, a final "game over" movie will be loaded.
Current structure of the program is: Base movie = Level 0 Click and Find control movie = Level 1 (6) .swf movies = Level 2
Abell1973
FlashKit > Flash Help > Flash ActionScript
Posted on: 03-18-2003, 10:25 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Control Function In Main Movie From Loaded Movie
I have a main movie (securityGrid) setup. It is a form for adding and updating user information for an application.
I have a second movie (empSearch) that allows me to search the user database, so I can add a new user to the application. I want to use this movie as the default search movie in other movies
I have an empty movie clip (holdMovie) in the main movie (securityGrid) that loads (empSearch) using a on press function with a button. It also passes in parameters from (securityGrid) to tell (empSearch) what the output parameter is and that it is a movie and not an HTML call. This part works fine.
loadMovie(empSearch + varString,_root.holdMovieMC);
After I use (empSearch) to find the person I want, I click a button to send that information back to (securityGrid). This part does not work. I've tried many methods of getting this work.
Set a global
outputResults = itm.empName + "," + itm.loginId
_global[outputVariable] = outputResults;
This works, but I can't find a way to trigger a function in (securityGrid) to unload (empSearch) and then fill in the add row form in (securityGrid).
_root.getAddUserForm(outputResults);
Does anyone have a simple example of what I am doing, so that I can possibly figure out what I am doing wrong? The movies and database are on a Intranet, so I can't post an example.
How Do I Get A Loaded Movie To Do A Function?
Hi, a "FirstTimer" here. I authored a movie clip, then duplicated it using "duplicateMovie." I then loaded images into both movie clips. So....one mc is authored, the other is programmatically made. The clips are named t1 and t2. I want to be able to click on the clips to have them load another movie in a clip called t4. The following code works on any clip (made for trouble shooting purposes) except the original clip that was duplicated and the one that is duplicated.
t1.onRelease=function(){
this._parent.t4.loadMovie("small/03.jpg");
}
I can do the exact same script with any other movie clip I author. I can place the code within the first one I authored, (t1) but since the other (duplicates) don't exist until runtime, I can't place the code within them. Any ideas as to why this code does not work with duplicated movie clips?
How To Ref A Loaded Movie's Function
i remember there was some standard instance name for referencing loaded clips:
_root.myMovie.loadMovie("externalMove");
_root.myMovie.tmp.callFunction();
I'm trying to call the a function that resides in the loaded movie, but can't remember the standard instance name for referencing it.
Anyone know the answer? Thanks
Running Function Of A Loaded Movie
Hello all,
I've got a parent movie that's loading external swf's into 7 container movieclips using the loadMovie() function. That's all good. I need to, however, have external images loaded into additional container movieclips INSIDE those swf's upon them being completely loaded into the parent movie. I know how to reference a movieclip loaded into a level, but if you're loading an swf into a container movieclip, how do you attribute an instance name to it for later referencing? It seems to me that loadMovie() doesn't have this quality.
Insight?
Calling A Function In Loaded Movie Clip
I have a movie with two frames. The first frame has the following code.
_root.createEmptyMovieClip("Nat1Holder",1);
loadMovie("Nat1.swf","Nat1Holder");
This frame loads the movie successfully.
In the next frame, I would like to call a function that is in the loaded movie "Nat1Holder".
My code in the second frame is .......
_root.Nat1Holder.populatefield();
This doesn't work though! Is it possible to call a function in a loaded movie?
Thanks
Loaded Swf Won't Call Function In _root Movie
Morning / evening! Hope people are well....
Problem: I thought functions were global? Why won't my SWF talk to my main movie?
I load a SWF into a container on my main timeline. I click on a 'button' within my loaded SWF, the 'button' does everything it's meant to internally, but doesn't call the maintimeline function. I thought the CONTAINER would take on all of the properties of the LOADED SWF, so scoping wise can't I just code the call to the function as I normally would.
Any advice would be much appreciated.
Thanks!
Calling A Function In The Main Movie From A Loaded Swf
I realize this is probably a very basic question, but I have loaded a SWF file into another movie. I now want to call a function in the main SWF. Is there a way to do that? Alternatively, I have a custom class where I could put the function, but I haven't been able to figure out how to call it from the loaded SWF either. Do I somehow need to associate the class with the main movie, or...?
Function For Empty Movie Clip With Loaded Swf
hi everyone!
this is really weird. i made a blank movie clip, and then made a movie clip laoder and called in a swf. when i do that it's great, and the buttons in the swf work well and everything.
Code:
var mcElfMap:MovieClip = this.createEmptyMovieClip("mcElfMap", this.getNextHighestDepth);
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.loadClip("heartmap.swf", mcElfMap);
but when i make a function for that movie clip, like say an onpress or something, it doesn't work... doesn't even register that it was pressed on!
Code:
mcElfMap.onPress = function():Void
{
trace("yes pressed");
}
mcElfMap.onRollOver = function():Void
{
trace("rolled over'd");
}
everything in the loaded swf has been turned into one big movie clip. it works fine, and all the buttons glow and do their thing, but if i instead make the onPress command in there, rather than in the parent swf, the command works but suddenly all the buttons don't work any more and it loses its functionality.
does anyone know how to fix this problem with loading external swf's and then doing stuff to them like making them draggable?
Calling A Function On Root From A Loaded Movie
Ok,
when calling a function on root from movieClip inside a swf Ive loaded onto a layer above what path can I use? I dont want to use _parent._parent._parent.function cos thats just stupid.
Ive tried _root.function
Ive tried _level.0
Neither of these seem to work for me. What am I doing wrong?
Unable To Access Function From Inside A Loaded Movie...
Guys,
I am new to Actionscript. Up till now I have only used flash for animation. So hopefull I make sence...
I have a movie called Loader.
In loader I have a tooltip function (fillTip) which shows tool tip for items in that movie (works fine in loaders.swf).
Now I am loading another movie (movie.swf) inside loader. I want to access a function located in the loader.swf. Being this is a second movie that is loading, I can use trace to check my problem...
I have tried _root.fillTip and _global.fillTip...
Please advise,
Shrini
Calling A Function That Is Whithin An Externaly Loaded Clip Form Another Loaded One
I am having trouble, I am loading external movies within a target that is on another movie clip. If I call it directly in that movieclip it works. What I need to do is call it from a button that exists in another movie clip. Help Please.
on (press) {
_root.paperSlide.my_mc2.loadClip("movies/apollo.swf", "secondaryContnent");
}
my function is called my_mc2 which is located on the firs key frame of _root.paperSlide.
if after the script in _root.paperSlide I call the function like my_mc2.loadClip("movies/apollo.swf", "secondaryContnent"); it works fine. But when I try to call it from a button within another clip that is externaly loaded as well it will not work.
please help, my head hurts.
Function Not Working After Clip Is Loaded, Unloaded And Then Loaded Again
I have a Movie Clip in my Library that I'm loading on to my stage using the attachMovie command. Within that movie clip, I have actions set on the first frame.
From the root level of my movie, I call "profile-section" clip by pressing a button in my nav and it loads properly and works. The functions and handlers all work correctly within it. Then when I press another button from the root level, I have code to removeMovieClip. That works and removes the "profile-section" clip.
My problem is when i click on the button to re-load the "profile-section", the function doesn't work properly anymore. I'm attaching the function for you guys to look over. Any help would be greatly appreciated. Thanks.
//
// Variables
//
var speed = 3;
//
// Sub-Section Rollover Red Bar Function
//
function subSectionRollOverLoop(movieClip, speed, distance, callBack):Void {
if (speed > 0 && movieClip._width <= distance) {
movieClip._width += speed;
} else if (speed < 0 && movieClip._width >= distance) {
movieClip._width += speed;
} else if (movieClip.__interval) {
clearInterval(movieClip.__interval);
movieClip.__interval = 0;
if (callBack) {
callBack(movieClip, speed, distance);
}
}
}
function subSectionRollOverStart(movieClip, speed, distance, callBack):Void {
if (movieClip.__interval) {
clearInterval(movieClip.__interval);
movieClip.__interval = 0;
}
movieClip.__interval = setInterval(subSectionRollOverLoop, 10, movieClip, speed, distance, callBack);
}
joan_btn.onRollOver = joan_btn.onDragOver = function ():Void {
subSectionRollOverStart(joanRoll_mc, 30, 140);
};
Passing A Function To Another Function In A Loaded Swf
Here is the problem: to make it simple, I have two swf's, one loaded into a movie instance of another swf. In the loaded swf, there is a function called checkClient with a variable passed into the function. Here is the code for checkClient
function checkClient(userID)
{
_parent.isResultCompleted(checkClient(userID));
}
isResultCompleted is a function in the root swf with the code
function isResultCompleted(functionToBeChecked)
{
functionToBeChecked;
}//end function check result
The problem I'm having is that functionToBeChecked dosen't call the function checkClient. The code in red is where I know the problem lies. Any ideas?
I have been trying to get this to work for a while now and have looked all over this forum, but nothing seems to give me a result that works. Thanks in advance. KD
Loaded Movie Clip To Talk To The Movie That Loaded It
Trying to get a loaded movie clip to talk to the movie that loaded it, but can't figure out the right ActionScript... . i'm using:
on (release) {
tellTarget ("home.swf") {
gotoAndPlay("blank");
loadMovieNum("viewer.swf", 2);
it ain;t workin, i've also tried _parent &
_root - in replace of 'home.swf' to no avail, much thanks to anyone that can help!!!
Preloader In Externally Loaded Swf Stops Working (loaded Into An Empty Movie Clip)
SEE BOTTOM OF THREAD FOR CURRENT PROBLEM
1. I have my navigation buttons in level0
2. When a button is pressed it loads an external .swf into the highest empty level
3. There is an MC in this loaded .swf called loadmovie and inside that another MC called empty.
4. Inside the 'loadmovie' MC, there is a frame action that loads another external .swf file into the 'empty' MC.
The problem I am having is that the preloader that is on the external .swf that is loaded into the 'empty' MC does not work.
It works fine if you test it on its own. But not when loaded into a Movie Clip.
MY SCRIPT:
iBytesTotal = _root.getBytesTotal();
iBytesLoaded = _root.getBytesLoaded();
iBytes = (iBytesLoaded/iBytesTotal)*100;
percentageNumber = Math.round(iBytes)+"%";
setProperty("progressBar", _xscale, iBytes);
Do I have to refrence it differently? Because of where it is situated?
e.g
iBytesTotal = _level32._root.loadmovie.empty.getBytesTotal();
confesed!
Call A Function In A Duplicated Movie Clip Form Another Function : (
i have a movie clip on my root name "pl".
on command, it duplicates with instance name as "y0","y1", etc.
here is the method :
function callPL(transmit,receive,addy,level) {
var newName = "y"+_root.x;
duplicateMovieClip("_root.pl",newName,101);
_root[newName]._x = 400;
_root[newName]._y = 400;
_root.[newName].start(transmit,receive,addy,level); //look here
}
there i attempt to call a function of the newly duplicated clip call "start()".
Start() function is written on the first frame of the movieclip like this :
function start(a,b,address,level) {
a.sendAndLoad(address,b,"Post");
this.path = b;
b.onLoad=function(success) {
gotoAndPlay("start");
}
}
however it seems like the function callPL() could not invoke function start() of the new movieClip.I have no idea how is it so.
Even when i trigger it with a onLoad handler it still doesnt work
pls shed some light.
Checking If Movie Loaded Into An Instance Has Fully Loaded B4 Playing
Hi,
I'm building a site that streams a series of small movies into some preset into instances on the _root timeline but are paused on an empty frame 1 until needed. So while the first movie is playing the second movie is already being loaded and is cued on frame 1 ready to play.
However, if the timeline tells the loaded movie (i.e. _root.content ) to play frame 2 before this movie has finished loading it will not play. This shouldn't happen because the movie loaded into _root.content should have loaded, but I need a failsafe.
Is there a way to run a routine once the _root timeline is finished to constantly check the status of the movie being loaded in _root.content and then play once it is loaded.
I've tried running this code in a routine:
if (_root.content._framesloaded >= _root.content._totalframes) {
_root.gotoAndPlay(2)
}
..but I'm not sure if it will work.
I really want to avoid a preloader (each movie is only about 10k big )
Any help would be greatly appreciated
Cheers
Loaded SWF Will Not Function
Hi,
i have set a couple of frame labels and at each label i am loading a new page
the swf works fine on its own but once it loads into the timeline all the functionality disappears
any ideas on what going on here?
thanks
Help The Var Is Loaded But The Function Is Not
i just create a random banner movie with link. just want to everytime reload the picture is different and with the link.
after working on it.. the radom load jpg is work.. but the like is not work.
i try to trace my link on my "lick_mc", it's undifind... why?
ActionScript Code:
this.loadVariables("link.txt")
var ads = 10;
var directory = "";
rad=random(ads)+1;
ad_mc.loadMovie(directory + rad + ".jpg", _level0);
this.attachMovie("link_mc", "link_mc"+rad, rad, {_x:0, _y:0, link:this["link"+rad]});
the sample like below
http://www.geocities.com/n_wong/random/ad.html
or who have better method.. like load XML, i want use it.. but don't know how.
thanks
Checking If A Movie Loaded With LoadMovie Loaded Succesfuly
Hi,
I have a movie called main. I want to load into a movieClip that sits in main an .swf.
To do it i use a
pictureClip.loadMovie("PR001.swf");
My question is: is there a way that the main movie can know that PR001.swf was not loaded?
Thanks fo the help.
Playing A Loaded Movie Clip (loaded In A Different Level)
I really don't understand the problem here, I'm loading a swf containing a movie clip with 2 frames with Stop(); on each. The file is loaded on _level5 so I tried this:
Code:
tellTarget (_level5.musicmc) {
gotoAndStop (2);
}
but instead of telling the musicmc movieclip to go to frame 2, it tells it to the main timeline to go to frame 2 and stop...What's the problem, when I use "Debug Movie", I can see the:
_level5
......._level5.musicmc (....... = spaces)
what's wrong, it seems to don't want to tell the MC to go to frame 2. I passed many hours on this simple d*mn thing and I really can't find out...
BTW, I'm using Flash 5
Urgent Loaded Movie Controlling Other Loaded Movi
I need this one done today!
I have two holder movie clips in my main .swf. One is selectloader, the other is normloader.
So selectloader.loadMov..... that works
In the select I load a selection with three boxes, the user chooses one.
When the user clicks one of the boxes I do
_root.normloader.loadMovie...
and it doesn't work!
So I created a new frame on the holder .swf for each of the three buttons so all the selectino has to to is go to another frame.
That works, but I also want each of the boxes to direct to a certain frame in normloader
so the problem comes back again
I can't get one loaded movie to control another loaded movie
I'm assuming it has to do with levels, and I need to do more then just _root.normloader.gotoAndPlay(3);
what do I have to do?
Clear Swf Loaded MC's With A Function
Hi there,
I posted earlier with a problem with a function that i have since figured out (although I hope that it works on all speed connections because, I was told that the "clip.gotoAndPlay(framstrart);" would not work because of it not being loaded in time.). I have been able to get the "load swfs into MC's" code to work. Its the clearing or unloading that I cant seem to figure out. Here is how far I have gone so far.
// this button first closes all the MC's then loads and plays the correct one
on (press) {
_root.unloadmovs();
clients = "clients.swf";
client = "_root.clients";
frameplace = "start";
_root.loadmovs(clients, frameplace, client);
}
// This is a separate button that just clears all the MC's
on (press) {
_root.unloadmovs();
}
//* these function went on the first frame of the main movie
// this one loads the swf and plays it.
function loadmovs (path, framestart, clip) {
trace ("this is in the function -loadmovs");
loadMovie (path, clip);
clip.gotoAndPlay(framestart);
}
// this one is supposed to go to a blank frame in the MC where nothing exists (clear the movie).
function unloadmovs () {
trace ("this is in the function -UNLOADMOVS");
clients.gotoAndStop("end"); // on MC "clients", end represents an empty frame on 300 with a stop action attached to it.
clients2.gotoAndPlay("end"); // more MC's with swfs to close
clients3.gotoAndPlay("end"); // more MC's with swfs to close
}
Both trace actions WORK and are outputed, but the MCs still display the swf even though I press the button to direct them to gotoandstop at "end" (frame 300). Ive tried all sorts of combinations and I just cant seam to figure it out.
Any help would be greatly apprectiated.
Thanks,
Nathan
Targeting A Function From Loaded Swf
hi,
I have the following function on the first frame of an swf:
Code:
function loadControl(mov2load, section_title) {
_root.informer.bytesLoaded = 0
_root.informer.bytesTot = 0
_root.informer.percent = 0
_root.tint_mc.gotoAndStop(2);
trace("CALLED");
_root.displayer.stop();
//
duplicateMovieClip(_root.copier, "holder", 100);
_root.holder._x = 1000;
loadMovie(mov2load, _root.holder);
//
_root.informer.onEnterFrame = function() {
bytesLoaded = _root.holder.getBytesLoaded()/1000;
bytesTot = _root.holder.getBytesTotal()/1000;
percent = int((bytesLoaded/bytesTot)*100);
trace("bytesLoaded = "+bytesLoaded);
trace("bytesTot = "+bytesTot);
trace("percent = "+percent);
_root.indicator._x = 796;
_root.indicator_2._x = 796;
_root.indicator._width = percent;
_root.displayText.text = "Loaded "+int(percent)+"% of "+section_title;
if (percent>=100) {
_root.displayText.text =""
_root.doneLoading(mov2load);
delete this.onEnterFrame;
}
};
}
This is to load in an swf into a holder clip off screen, and then load it into the display clip when loaded.
This works fine when calling the function from the main swf, but when I try to call the function like from the swf files that I load in it calls it but the traces on the 'onEnterFrame' function loop out 0 for all the preload values.
I am calling in the function from the loaded swf's like this:
Code:
_parent._parent._parent.loadControl("clothes.swf", "Moose");
Can anyone tell me what is wrong with the onEnterframe part (or others)
Thank you
NextScene() Function With Loaded Swf
on (press) {
_root.folioMovie.nextScene();
}
I used the loadMovie() function to load the movie "Corp_ID.swf" into a movie with the instance name folioMovie, but the button function nextScene() does not seem to work. What am I doing wrong?
Thanks in advance for any help.
In Function (bytes Loaded) Go To And.....
i am making a preloader for a huge game i made that has tons of levels and etc.. what i want to have happen is instead of loading it all at once, i want to make it so that after a certain amount of bytes load, u are able to start playing the movie, so u dont have to wait and while ur playing it continues to load, so is there any way to figure out how many bytes are loaded and then i NEED it in a function, its just like a thing i need because .. i heart functions, lol but yeah so is that possible in a function, or like the if frame is loaded go to and play (in a function) any help or links will be appreciated! no rush because its christmas, and im just fooling around testing out stuff! thanks
How Do You Call A Function In A Loaded Swf ?
hey this is my first post so thank for your time,
im trying to activate a function in a swf that I loaded dynamically using loadMovie() in flash 8 pro.
im trying the dot syntax (ie:_root.mc.function()) "mc" being the movieClip instance i loaded the swf in.
but it's not working can any one could give me a hand.
thanx
[CS3] Launching Function In Loaded Swf
createEmptyMovieClip("debugger_mc",999);
var loadListener:Object = new Object();
loadListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void {
trace (""+target_mc)
target_mc.errorMessage ("sdsdsd")
};
loadListener.onLoadInit = function(target_mc:MovieClip):Void {
};
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mcLoader.loadClip("debugger.swf",debugger_mc);
__________________________________________________ ____
on load completed it should launch the function errorMessage...instead nothing happens...how is it possible????
Function Gets Called Before It Is Loaded.
Hello, I'm having a bit of a problem with a function inside a movieclip which I call from the _parent timeline.
ActionScript Code:
stickerContainer.appear();
unfortunately it looks as if my movie has become too extensive because the function gets called before the movieclip is loaded. (when tracing the function it returns an undefined) One way I found that offered a workaround for this problem is to use a setInterval but this is hardly efficient.
Another thing I tried was exporting the movieclip in the first frame, but unfortunately that didn't do any good either.
My question is twofold: is there a reason for why it's doing this and what other solutions might there be...
Return Loaded XML From Function?
Hey everyone
I'm trying to figure out how to do this. I'm making an XMLLoader class, that I want to be able to use like this:
Code:
var myXML:XML = XMLLoader.load("SELECT * FROM table");
trace(myXML); // traces the loaded XML
I just can't figure out how to make the load function inside XMLLoader return the XML object... I can easily register an evenlistener that calls another function when the XML is loaded.. but how do I then make the load function return this XML? I want to do this:
Code:
package
{
public class XMLLoader
{
public function XMLLoader()
{
trace("Constructor called");
}
public function load(sql:String)
{
// Call a php site to recieve XML
// add listener to notice when XML is loaded
// return the loaded XML
}
}
}
The thing is, that I want to keep all event-stuff inside my XMLLoader, so I can use the class like the first example.
One way around it is to make a while loop inside the load function that checks whether a boolean is tru or false. When the XML is loaded, I set that boolean to true and the laod function returns the XML. But it's really taking up all the CPU power, and NOT a nice solution..
In a bunch of other programming languages you have the sleep function, that let's you sleep e.g. a part of a functions code until a variable is set, and then you can return it only when it is set.
How do I do it?
Call A Function Out Of Loaded Swf
Hello,
I try to build a reader app with Flex.
The app should display external SWFs.
Example:
I load a swf ("page.swf") into a loader in "reader.swf".
In page.swf are some buttons.
Each button has its eventListener:
buttonxyz.addEventListener(MouseEvent.CLICK, show_info);
The function "show_info" reads the eventTarget and makes some action depending on the target.
Here ist the problem:
The function "show_info" is not part of page.swf. It is part of reader.swf.
I tried different ways to call the function, but it did not work.
When compiling page.swf I get the error that the function "show_info" is not part of page.swf.
Can anyone explain how I get this to work?
Thanks
Beneq
Attach Code
buttonxyz.addEventListener(MouseEvent.CLICK, show_info);
How Do I Add A 'onRelease' Function To Loaded Mc's
Hi! Could anyone take a look at my code. It only displays a square.
Code:
testClass = new Object();
testClass.childClass = new Object();
function doTest() {
_root.attachMovie("empty_mc", "container", 0);
testClass.test = _root.container;
// Hmm.. Am I right on this? If I were to write code in Java equivalent to this, would that code be like:
// obj_name = new testClass.childClass()
testClass["obj_name"] = new testClass["childClass"]();
// But the thing is that, the testClass object holds the newly created "obj_name" in it. Am I right?
// Just attaches it to _root. Voila! It shows on the stage.
testClass.test.attachMovie("square_mc", testClass["obj_name"], 1);
}
doTest();
How can I add an 'onRelease' function to the childClass?
I tried this:
Code:
testClass.childClass.onRelease = function() {
trace("onRelease called");
}
Doesn't work...
Help please?
Calling A Function From A Loaded .swf
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.
Help: Access A Function From Loaded Swf
I know this must be really simple, but I'm stuck in that and I need to finish 10 other thousand things for today...
I'm trying to access a function that's on the document class, from a loaded swf.
I load an external banner, and when the banner has finished playing I want to call a function.
I'm trying:
myfunction();
this.stage.myfunction();
this.parent.myfunction();
with no luck...
Thanks
Play A Frame In A Loaded Movie From Another Loaded Swf
this is driving me crazzzzy []
i have the main movie which is 1 frame (containing the menu navagation for the site), under the 1 frame i have an MC (called scoot) that is 8 frames long and each frame has a stop action. I have set the site up to use browser back/forward button <script>
varPass=location.search.substring(1,location.searc h.length); //grab variable from cgiPass
if (parent.main.num == 1)
{parent.main.num = 2;}
else
{parent.main.num = 1;}
parent.main.controlFlash(varPass);//call controlFlash funct in main.html
document.write(varPass); //for testing purposes
</script>
the above script is a sample from the back/forward function/procedure.
Now... I labled the 5th frame of scoot as "map" and under the 5th frame, when it is played, is a button to open another swf, i'll call swf2. In swf2 is a button that i'm trying to action to go back and play map of scoot. But what ever i try nothing seems to work. Swf2 is loaded into level3 of the main movie and the loading action is in the first frame (and only frame) of the main movie. Someone please help me..... ???? Thanks a gekadrazillion in advanced !
Detect When Loaded Movie Is Fully Loaded
hey all,
I am trying to load an external swf into a target. when the swf is completely loaded, i want to execute the next set of actions.
Now here is the bit i'm stuck. I am trying to develop my flash websites so that no coding is done within the child swfs.
so i would assume some code like this would work:
_root.holder.loadMovie ("child.swf");
if(_root.holder.getBytesLoaded ==_root.holder.getBytesTotal){
_execute some other command;
}
However it doesn't work!!!
So is there a way to detect when a specific child swf has fully loaded into a target (not _framesLoaded please!) and then set a variable to allow some other actionscript to kick in?
please help if you know,
using mx btw
cheers,
Kd
Remove Loaded Movie After New LoadMovie Has Been Loaded
i need to unload a movie once the new loadMovie is fully loaded because once i click on my button to do so, my current loaded movie goes away & the screen is white until the new loaded movie is loaded. (i hope that made sense)
Loaded Movies Don't Function In Holder
Hi
When i load a movie into a holder the buttons don't function where as if i just use load movie it works fine. any suggestions as i need to use a holder to position it?
thanking you
miffy
Accessing Loaded Variables From Within A Function
I want to be able to load variables from a text file and use them to load corresponding flash files.
The variables load fine onto the root movie
ie PrintJob[1] = example.swf
But when I want to call the following function, It doesn't generate the correct address to load the movie from.
function load(path, arrayName, arrayNumber) {
file = Arrayname[arraynumber];
Goto = path + file;
loadMovieNum(goto, 10);
}
For example, the function is called using :
Load(content/print, PrintJob, 1)
It doesn't work
So I try
Load("content/print", "PrintJob", 1)
It doesn't work either.
So I change the function to this to test if the correct variable is being accessed:
function load(path, arrayName, arrayNumber) {
file = PrintJob[1];
Goto = path + file;
loadMovieNum(goto, 10);
}
And lo and behold, the Function cant asign the variable 'file' to the content of 'PrintJob[1]' even though PrintJob[1] exists as a loaded variable.
HELP ME FOR GODS SAKE
HOW do I access these variables from within a function.
Thanks
Href To Function From Loaded Text
I have a text file that I'm loading with loadVariables. I'm using html in the text file and I want to call a function from the text file via the href command.
I have in my text file:
<A HREF="asfunction:Clicked,http://www.google.com">click here</A>
I have also tried:
"<A HREF="asfunction:Clicked,http://www.google.com ">Click Me!</A>";
The function I'm calling is:
function Clicked(linkName){
trace("In here");
trace(linkName)
};
These don't work.
Can anybody help me in getting this working.
Thanks
Call A Function By Loaded Movies
2 movies: main.swf + thing.swf
In de main.swf movie clip i have this function:
tracewhatsup = function (){
trace("What's Up?");
};
The thing.swf is loaded to the main.swf
QUESTION: How can my thing.swf movie call the tracewhatsup function that is located in the main.swf movie?
I am using this actions in the thing.swf movie:
_root.tracewhastup();
What i am doing wrong?
Can anyone help me?
Thanks!
P.S. - Sorry for my english!
Execute Function In External Loaded Swf
Peepz,
I have a loader class which loads an external movieclip, in my complete handler i want to execute a function (functionname = loadLessons) on keyframe 1 in de external loaded swf:
PHP Code:
//Loader Class
function loadPage(url, holder):void
{
var assetsUrl:String = url
var loader:Loader = new Loader();
configureListeners(loader.contentLoaderInfo);
var assestsRequest:URLRequest = new URLRequest(assetsUrl);
loader.load(assestsRequest);
loader.addEventListener(Event.COMPLETE, completeHandler);
holder.addChild(loader);
}
function completeHandler(event:Event):void
{
trace("completeHandler: " + event);
//event.target.loadLessons()
var init:Function = event.target.loader.parent.loadLessons
init()
}
But i get this error:
TypeError: Error #1006: value is not a function.
at index2_fla::MainTimeline/completeHandler()
Con somebody let me execute the function?
Thnx!
[F8] How To Have A Parent SWF Call A Loaded SWF Function
Real basic but its causing me a fit in AS2 Code.
2 SWFs. A Parent called AS2_Parent.swf. It has the following code on frame 1
PHP Code:
var game:MovieClip = this.createEmptyMovieClip("game", this.getNextHighestDepth());
var gameLoader:MovieClipLoader = new MovieClipLoader();
var gameListener:Object = new Object();
gameListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
}
gameListener.onLoadComplete = function():Void {
trace ("Parent has is loaded Child");
game.childTrace("Child: Hello World");
game._x = 100;
}
gameListener.onLoadError = function():Void{
trace("Load Error")
}
gameLoader.addListener(gameListener);
gameLoader.loadClip("AS2_Child.swf", game);
function parentTrace(pMsg:String):Void {
trace("Parent Trace> " +pMsg);
}
stop();
The Child Movie is call AS2_Child.swf
It Has in Frame 1:
PHP Code:
childTrace = function(pMsg:String):Void {
trace("Child Trace> " +pMsg);
}
_parent.parentTrace("MSG from Child");
Now The Parents call to the Child SWF does not work, but the childs to the parents works.
What Am I going wrong?
Thanks
How Do I Call A Function Once An Array Has Been Loaded?
hi everyone
i am doing a thumbnail gallery
i use a listener to make sure that the thumbs have been loaded before i set any function to them, but the problem i seem to have is that the listener is set for each thumb individually, and i would like to wait untill all the thumbs have been loaded before i set an action to them
does anyone know how to do it?
thanks
|