Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




If Jpg Is Loaded



Hi there

im loading a jpg to a Mc and i want to know when the jpg is loaded
so i can give a play() comand (or any other comand)to the Mc.

is it posible?


Thanks,

Che



FlashKit > Flash Help > Flash MX
Posted on: 06-30-2003, 06:51 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

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!

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.

Load Bar Progress Using Bytes Loaded As Opposed To Frames Loaded
My problem now is that I would like to build a preloader with a load progress bar etc., that is based on bytes loaded rather than frames loaded.
This is because I have most of my content loading in movie clips on just 1 or 2 different frames within the movie, perhaps bad design but somewhat of a necessity due to nested clips. So, the load bar hangs on these one or two frames for a long time while preloading, whereas if it could be based on bytes loaded the load bar would have a nice gradual sliding effect. I've been playing around with it myself but have yet to get if functioning. Any help would be greatly appreciated.

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

How To Make Sure Randomly Loaded Externals Swfs Are Fully Loaded [F8]
I am randomly loading external swfs into my main movie. I've got the random part working. However, I don't know how to make sure the random swf is fully loaded before jumping to a specific frame in my main movie.

I have a preloader inside each external swf, but I don't know how to make my main movie understand that the random swf is completely loaded before the main timeline should gotoandPlay("start").

What I Have So Far:

I have a blank MC (named "location") on the main stage, which I am using to hold the random swfs. On the first frame inside this MC, I have the following code:

choice = Math.round(Math.random()*2);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image1.swf");
break;
case 2 :
location.loadMovie("image2.swf");
break;

}

Loading the random swfs is working perfectly. But after the external swf is fully loaded, I want to move onto a frame labeled "start" on the main stage. I just don't know how to make sure the random swfs are completely loaded before I say gotoandPlay("start").

I've tried piecing together bits from so many tutorials, and I just don't know what I need to do to make it work with my current code.

Thanks so much!

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

Setup Loaded Movies To Work Loaded Or Standalone
Hi Guys

How do I get a movie to work as a standalone movie - when i'm building it - and also work as a loaded movie in a parent movie that loadMovie or loadMovieNum this movie.

It just get annoying having to always change paths after I finish building my sub-movies because half the time I get it wrong - it might take me a couple of hours to get the move working as a standalone, but then i can take more hours to get it working as loaded.

any ideas??

thx

How To Reference A Loaded Swf, When Loaded Inside A Loader Component?
I am trying to control a movie (swf) that I loaded into the flash loader component. I have two files: preloader.swf and movie1.swf.

Preloader.swf has the Flash component from mx.controls.loader.
I have given this component the instance name "myLoader".
Once preloader.swf is called, it loads movie1.swf.
Movie1.swf has a button that controls the frame of a mc played within movie1.swf. When I test the movie1.swf without loading it into the preloader component, the button works as expected. However, when I load movie1.swf into the preloader.swf, it doesn't control the play of the mc.


#This is the AS I attached to button in movie1.swf when I am loading movie1.swf into the preloader.swf. Which DOESN't work.

_root.myLoader.mc1.gotoAndPlay(10);



#This is the AS I attached to button in movie1.swf when I am playing movie1.swf WITHOUT loading it into the preloader.swf. Which DOES work.

_root.mc1.gotoAndPlay(10);



I can't seem to figure out how to reference the loaded movie in the preloader.

Any help would be appreciated.

Thanks!

Problem With How Dynamic Loaded Text Is Displayed When Loaded...
Hello!
Ive been struggeling all day with this!
I found a code in this forum on how to scroll and load a .txt in a dynamic textfield in flash 2004 (thx alot timothye )
This all works, but the problem is that I cannot get it to display some text bold. the
HTML Code:
<b></b>
does not work... why?! I did the same thing in flash MX and here it works just fine!
any help will be most welcome!
I'll post the flash for u to have a look at!

thx!

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);
};

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?

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 !

Controlling Loaded Movies That Arent Quite Loaded Yet
Hello everyone. I am having an issue with loading an swf into an MC and having it go to a specific frame. The problem is I have one long on (press) thing going on where on press approx. 15 things happen like unloading movies loading movies etc.. The path I am using is correct I think the problem is the movie hasnt loaded yet by the time this line in the acionscript is hit. So it's like I am asking it to play a frame in a movie that hasnt loaded yet. I cant really think of a solution to this and was hoping someone here could. I thank anyone in advance for their help. I was thinking an if frame loaded thing but I really just dont know.

Checking If A Dynamically Loaded Object Is Loaded
This example deals w/ sounds, but I have a similar problem dynamically loading images so I think this is really all about dynamically loading any object in Flash MX.

If you are loading an object dynamically, how do you check to see if it's loaded?

My Example:

I'm re-using these sounds, so I'm creating a home for them like this:
mySound = new Sound(mySoundMc);

Then I load them:
mySound.loadSound("introduction.mp3", false);

Later, I'll start the sound (w/o waiting for it to load.)
mySound.start();

But if its not loaded yet, It won't play. Likewise, I imagine if an image isn't loaded yet, it won't display ... but I haven't gone down that road yet. One thing at a time.

Thanks.

_______________________
For reference this is, exactally, how I'm loaing the object.

for (i=1; i<39; i++) {
set("FrameSound" add i, new Sound(eval("McFrameSound" add i)));
eval("FrameSound" add i).loadSound("slidesounds/frame" add i add ".mp3", false);
}

Is It Possible To Change Levels Of Loaded Movies Once They Are Loaded?
once i load and external movie to designated level, is it possible to then change it's level after it is loaded.

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

Keep The 1st Loaded Movie Visible While The 2nd Is Being Loaded To Replace It?
when you have an external movie loaded in an empty mc, how do you keep that movie visible when the preloader is trying to load another external movie to replace that movie?
Thanks!

Dynamically Loaded Swf Stops Functioning When Loaded
i have 2 very simple working swfs (main.swf and loaded.swf). Problem is, when i dynamically load one into the other, it doesn't function properly anymore.

Details - the loaded.swf that gets loaded has a dynamic scroll (reading from a txt). when i test the main.swf the entire loaded.swf scrollls and not just the text.

- files attached -
help!

Can A Loaded Swf Access Properties And Methods Of The Swf That Loaded It?
Question in title.

Basically, I have a swf, call it 'main.swf'. 'main.swf' will load 'module.swf' using a Loader. I can access 'module.swf' using loader.content from 'main.swf' (assuming my Loader was called loader).

But how do I access 'main.swf' from 'module.swf'?

Thanks.

Manipulating Loaded Movies Before They Are Fully Loaded
Is there any way to manipulate a movie, e.g. play, stop, roll over etc. that has been loaded using loadMovie or loadMovieNum BEFORE it is fully loaded? From the LOADING movie that is. Not the LOADED movie...
If so. How?

Accessing A Loaded Swf's Properties (loaded By MovieClipLoader)
Morning all,

Basic problem is:
1) a swf is loaded into the "main application" using MovieClipLoader
2) loaded clip loads fine and is displayed... ok so far
3) main app then tries to walk through the content of the loaded clip... but it can't see anything

In the following example imagine a swf called level1.swf with a single movieclip "object1" on one frame.

Code (variables names changed to protect the innocent):


Code:

public function blah()
{
mciLevelData=mciGame.createEmptyMovieClip("mciLevelData", REALLY_HIGH_DEPTH);

var ml:MovieClipLoader = new MovieClipLoader();

var listener:Object = new Object();
listener.onLoadInit = Delegate.create(this, onLevelLoad);

ml.addListener(listener);
ml.loadClip("level1.swf", mciLevelData);
}

public function onLevelLoad(target:MovieClip)
{
trace(target.object1);

// debug func which walks through *all* child movieclips
// and spits their names back
trace(walkTree(target));
}
... now, I'd expect the output from the first trace to be something along the lines of " _level0.mciGame.mciLevelData.object1"... but it actually outputs "undefined".

The second trace doesn't do anything - it can't see any children of this clip.

Odd

So, how can mciLevelData seem to exist, have data loaded into it successfully but I'm not able to access any of the content loaded into it?

Please help! I'm going bald from the amount of hair pulled from my scalp.

matt

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)

Kill Button On A Loaded Swf That Removes Itself (loaded Swf)
I have a swf loading another swf. The loaded swf has a button (mc) whose purpose is to unload (kill) itself (the swf). Anyone know how to code this?

Thanks so much for your time.

Loop Through Loaded Vars To Check If Loaded
Hi

say i have 3 text files that look like:

myarray=blah, blah, blah&finished=1

How can I load the files with a loop then loop through the 'finished' var to check that they are all loaded?

thanks
L

Loaded Swf Wont Stop After It Is Loaded.
Hello Everyone.
I have a movieclip(slides) that I am loading external swf files into. I have a stop button that loads a swf file and then it trys to stop the movie that I have just loaded. For some reason it ignores that stop command. How can I keep the movie from playing after it is loaded besides placing a Stop action in the first frame of the external swf file itself.

on (release) {
loadMovie ("slide1.swf", "slides");
slides.Stop();
}

Thank you all in advance.

Dynamic Jpg Does Not Show When Loaded From A Loaded SWF
Hi

Posted a question about this last week, but I had some problems to explain my problem! So I try again!

I got one SWF file that has a movie clip that loads a JPG. This works fine when I run the SWF by itself.

I want to load this SWF from another SWF but when I do it wont display the image!

I have tried to load the image to different levels. If i load the the jpg to a level where I have another SWF file the SWF is unloaded but the picture still does not display!

I do not think this is a scripting problem becaus it seems to load the picture but not displaying it!

Does anyone know a workaround for this!


Cheers

Jonas

Controlling A Loaded Swf From Another Loaded Swf (both In Index.swf)
I have an index.swf that loads the menu.swf (level4)and the info.swf (level5)

the info.swf had buttons in it that controlled it (slides info across page):
on (press) {
/:Box_RollBack = 1;
/:destination_menu = 2;
/:menu_rollback = 1;
/:menu_difference = /:current_position-((/:destination_menu-1)*/:menu_width);
}

All works good... till

I want to do the same thing but have the button that did that in the menu.swf

Is there a quick fix here or not? What can i do?

Getting Loaded Movies To Stop When Loaded
I'm going nuts trying to figure this out!!

I'm obviously a newbie, and I haven't got a clue how to get these things to work. I have a very simple blank movie, which I'm using as an Intranet banner, and I have 2 very simple movies loading into it. I want the movie to stop once the second movie is loaded. I'm sure this is very simple, but I can't figure it out!

Can anyone help me please?

Thanks,

allison

Looping A Loaded An Externally Loaded Mp3
I was trying to loop an externally loaded mp3 and suceeded on my machine, but when I upload the swf and mp3, the function will not work in my browser (IE). I tried a relative path, as well as the absolute URL and neither worked. Here is the code I used to loop the externally loaded mp3:

loopSound = function () {
my_sound.loadSound("whisper.mp3", true);
};
my_sound = new Sound();
my_sound.loadSound("whisper.mp3", true);
my_sound.onSoundComplete = loopSound;
my_sound.setVolume(45);

Any help would be most appreciated, I have wasted a lot of time on this already.

[F8] Checking If A Dynamically Loaded SWF Has Loaded...
I am loading one SWF into another with the following code:

var contentClip:MovieClip = _root.createEmptyMovieClip("contentClip",(_root.ge tDepth()-1));
contentClip.loadMovie("searchResults.swf");

That works fine. Now, I want the loaded SWF ("searchResults.swf") to perform some actions after it has loaded. I tried the following code on the first frame of the loaded SWF, but it didn't work:

this.onLoad = function (){
//SOME FUNCTION
}

It DID work, however, when I changed the "onLoad" to "onEnterFrame". But that doesn't do what I need it to, because I only want the function to happen once after the SWF has initially loaded - not every frame...

Is this possible? Thanks!...

Keeping Loaded Swf's Loaded - MovieClipLoader
Hi All... Just a quick one for you...

I've managed to split my main .swf into separate .swf's and I have them loading externally into my, now much smaller main .swf using MovieClipLoader.....

Everything is working great and the process was pretty smooth - however, my separate .swf's for every "page" are reloading every time I return to their "page" - how do I make it so that the external .swf's stay loaded ??

There's a Mr.T smiley in it for the 1st to come up with the solution

Cheers
Jimmy
(CS3 / AS2)

Can A Loaded SWF Call Functions On The SWF That Loaded It?
I'm using a Loader object to load a SWF, I want to know if that SWF that gets loaded can call functions on the same timeline as the original Loader object?

If I trace this:

Code:
trace(swf.loaderInfo.loader.loaderInfo);

it gives me the Loader object I use to load the swf, so if I want to access a property or method on that timeline, I would think I could do this:

Code:
trace(swf.loaderInfo.loader.loaderInfo.someProp);

OR

Code:
trace(swf.loaderInfo.loader.loaderInfo.someMethod());

but it errors out on me??

any ideas? thx!

Help Keep Loaded Movieclip Over Other Loaded Movieclips
I'm loading an external swf that is a button to close other loaded movies. I want it to stay above all the other movies at all times so that the user has a way to close them and go back to the main stage. There are buttons on the stage that load external movies and the close button movie loads automatically. All of the movies load in fine but once I load in a movie from a dynamically created movieclip button on the stage, it covers up the close button movie.

The following code is where I dynamically load movies from the dynamic movieclip buttons and then after that is where I load in the external swf for the close button.


Quote:




//Dynamically assign external movies to load from
//the dynamic buttons
for (j=1; j<holderArray.length; j++) {
this["btn"+j].jValue = j;
//this["btn"+j].useHandCursor = false;
this["btn"+j].onRelease = function() {
movie = topics[holderArray[this.jValue]]+".swf";
loadMovieNum(movie, 100);
_root.movieloader.swapDepths(16000);
};//end of onRelease
}//end of j for loop
}//end of i for loop

//Start of new movieclip
var mc:MovieClip = _root.createEmptyMovieClip("movieloader", _root._level300);

mc._x = 665;
mc._y = 524;

var mcl:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
mcl.addListener(listener);
mcl.loadClip("Close Button.swf",mc);

listener.onLoadInit = function(theMC:MovieClip) {
theMC.onRelease = function() {
if (_root._level100 == Number(_root._level100)) {
unloadMovieNum(_root._level100);
} else {
_root._level100.unloadMovie();
}
};
};//end of new movieclip




Thank you in advance for any help!

Number Frames Loaded From Loaded Swf
Anyone know if it is possible to get the number of frames that have been loaded from a swf that is loaded into another swf?

For example I am loading a fairly long timeline animation, and I would like to start playing that animation if the first 200 frames have been loaded. I have been playing with URLStream but I haven't figured out how do get the information i'm after from that.

Any ideas?

Thanks!

Loaded Swf Won't Work The Second Time It's Loaded.
I'm using the great flip book code from iparigrafika.hu

I have an odd bug when loading the 'PageFlip' swf into by base swf.
It loads into level10 using the 'loadmovie' action.
It loads the swf and works perfectly but if you load a different swf and the reload the 'PageFlip' swf, all the page turning functions don't work???

the 'FlipPage' is at this link ---> http://www.iparigrafika.hu/

By the way it's a fantastic bit of coding and well worth playing with, if unlike me you know what your doing!!!

Loaded Movie Won't Play When Loaded Into Mc
Hi flasheads. I have an interface that has a button that loads a swf of an infinite menu. When I try and load it into a movie clip it won't work. It won't scroll. When I load it into a level it works but I need to load it into a movie clip. If you have any insight please tell me. thanks group.

_root.brian.thanks

Externally Loaded Swf Does Not Stay Loaded
Hello,

I am loading an externally loaded swf that uses a mask to transition in. When the user clicks a different button I am doing a gotoAndPlay that goes to a mask that "unloads" the content (it doesnt actually unload the info is just outside of the mask area. As soon As I jump to that section the movie is no longer loaded and just shows the container clip that I had created for it. The Container Clip is never changed and is the same throughout the whole process. The only thing that changes is the mask animation.

Any input onto why this would happen would be greatly appreciated.

I have tried both loadClip and loadMovie but no luck on keeping the clip loaded.

EDIT
- I have narrowed it down. When I change the mask movieclip the movie unloads for some reason. Is there a way I can keep it loaded?

Help Keep Loaded Movieclip Over Other Loaded Movieclips
I'm loading an external swf that is a button to close other loaded movies. I want it to stay above all the other movies at all times so that the user has a way to close them and go back to the main stage. There are buttons on the stage that load external movies and the close button movie loads automatically. All of the movies load in fine but once I load in a movie from a dynamically created movieclip button on the stage, it covers up the close button movie.

The following code is where I dynamically load movies from the dynamic movieclip buttons and then after that is where I load in the external swf for the close button.


Quote:




//Dynamically assign external movies to load from
//the dynamic buttons
for (j=1; j<holderArray.length; j++) {
this["btn"+j].jValue = j;
//this["btn"+j].useHandCursor = false;
this["btn"+j].onRelease = function() {
movie = topics[holderArray[this.jValue]]+".swf";
loadMovieNum(movie, 100);
_root.movieloader.swapDepths(16000);
};//end of onRelease
}//end of j for loop
}//end of i for loop

//Start of new movieclip
var mc:MovieClip = _root.createEmptyMovieClip("movieloader", _root._level300);

mc._x = 665;
mc._y = 524;

var mcl:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
mcl.addListener(listener);
mcl.loadClip("Close Button.swf",mc);

listener.onLoadInit = function(theMC:MovieClip) {
theMC.onRelease = function() {
if (_root._level100 == Number(_root._level100)) {
unloadMovieNum(_root._level100);
} else {
_root._level100.unloadMovie();
}
};
};//end of new movieclip




Thank you in advance for any help!

CSS File Loaded In External SWF That Is Loaded In
CSS file loaded in external SWF that is loaded in the main SWF

Main SWF:
has an action
load "external.swf" in mc target > "content"

external.swf
has following code:

var myStyle = new TextField.StyleSheet();
myStyle.onLoad = function() {
myText.styleSheet = this;
myText.html = true;
myText.htmlText = myHTML;
};
myStyle.load("name.css");
myHTML = "<p class = 'contentheading'>HEADING</p>"
myHTML+= "<br><p class = 'content'>Text.</p>."

The problem is that the text wont appear in the textfield "myText".
Probally it can't find the "name.css". or maybe something else.


The same problem occurs when the code, that is in external.swf, put in the main.swf but placed in a mc.


Anyone who can solve this?

Loaded Swfs And Loaded Flvs
heya all

i'm using this bit of code


Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

vidPlayer.theVideo.attachVideo(ns);

ns.play("videos/M1_v5.flv");
to load in and play a video in a swf. works great!

here is where I'm running into a problem, when I'm loading the swf (with above code) into another swf the movie does not play.



Can anyone shed some light on this situation? It's been driving me nuts all morning.

[f8]when My Text Is Loaded In Flash Only A Part Of My Text Field Is Loaded
Hi can anyone help?
when my text is loaded in flash only a part of my text field is loaded and
yes its multi line. attach is the source file

Loaded MC Control Other Loaded MC.. How?
Howdy,

I have 3 SWF.
the 1st (index.swf) is calling the other 2.. menu.swf and main.swf. Something like frames in html...

but.. I can't get my buttons working on my menu.swf...

I want to go to some scene in main.swf with an action on a button at menu.swf

I have this:

on (release) {
tellTarget ("_root/main") {
gotoAndPlay ("scene4", 1);
}
}

It doesn't work!

But when i use stop it works! Like this:

on (release) {
tellTarget ("_root/main") {
stop ()
}
}

Anyone can help me?

Grrr. Loaded Not Loaded.
I am trying to get things to size based on the size of imported JPG.

Trouble is, even when I use a getbytesloaded/getbytestotal for each JPG to make sure, Flash occasionally gets ahead of itself and doesn't give the correct size of the JPG.

This is usually the first load of the day - after that it works perfectly.

Any ideas?

XML Is Not Being Loaded If The Swf That Loads It Is Being Loaded In Other Swf
Hi!
I have a swf file "a.swf", which loads the xml file. If I am loading this "a.swf" in some other swf file say "b.swf" , "a.swf" doesnot load the xml file.
This is really creating a serious problem. Do anyone of you have face this problem earlier? Please check it out and suggest some workaround.
Thanks in advance.
Ajay K Chaudhary.

If Loaded Movie Is Loaded?
there is a function for if frame is loaded. is there one for if loaded movie is loaded. the script is not frame base so i can not use "if frame's loaded" function

christian

Controling A Loaded Swf With Another Loaded Swf
I have a blank stage with only AS that loads an swf addChildAt(0) and a second one addChildAt(1). This works. When the user interacts with (1) it calls another addChild (not indexed) and possibly that one loads another, depending on the choices made by the user. How can I get any of these to control that very first child that was loaded at (0)? I have run out of ideas.

Some of the code:

(on the main swf, nothing on the stage, only code that loads the next two)

addChildAt(pHolder, 0);
pLoader.load(pURLReq);
pLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, pLoaded);

and for the second:

addChildAt(mHolder, 1);
mLoader.load(mURLReq);
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, mLoaded);

On the child of childAt(1), I have:

function replaceSWF(e:MouseEvent):void
{
pLoader = new Loader();
pLoader.load(new URLRequest("p.swf"));
pLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, placeNewClip);
}

function placeNewClip(e:Event):void
{
removeChildAt(0);
addChildAt(e.target.content, 0);
}


If I use this exact same code from that very first swf, the one that loads the first two external swfs, it works, but once I put it on one of hte other loadeds and sub loaded swfs, I can't get it to work. In the current state (0) it just makes everything on the stage disappear, so I figured then using the index of (1) would do it, but that or any other number results in absoluly nothing.

Help! I am really out of ideas here.

(the stacking looks like this) ---
sub second loaded SWF <==== needs to tell first loaded SWF to unload then load a new swf at same index
second loaded SWF <==== loads the next one above
first loaded SWF <=== needs to be removed and another swf loaded at the same index
mainSWF (loads two others) <=== code placed here works for first loaded SWF

Loaded Txt Data Not Yet Loaded?
I have a txt file which my flash movie loads two rather long variables from. I give the movie 1 frame to load and on the next frame, start displaing some of the loaded variable. When I run the .swf none of the data shows, however when I right click -> Rewind -> Play, it runs perfectly.

Could this be because the data loaded from the text file is not complete in the time of 1 frame. I've also tried giving it up to 30 frames to load but still the same result.

I've tried 2 methods of loading the txt file:

loadVariablesNum("textfile.txt", 0);
and
_root.loadVariables("textfile.txt");

Both give the same result.

@25% Loaded Do This @50% Loaded Do That Question
How on earth do i get something to happen at 25% loaded / 50% loaded etc etc...

I have a pretty standard text loader that starts at 0% and counts to 100%...I would really like to add a little bit more to it so i thought that upon say 25% something could become "visible" or tween in....But after struggling for the past 2 hours to get this to happen and digging around on the net I've had to resort to begging for help here..gagin.


So....( this code is just so you get the right idea of what i mean)


Code:

this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadingEvent);

function loadingEvent(e:ProgressEvent):void {
   if (bytesLoaded==25) {
   myAmazing_mc.visible=true;
   }
}

Controling Loaded Swf With Another Loaded Swf
I see lots of posts about this type of stuff, but I haven't found this one ... at least not yet.

I use a main, empty movie as a base. It only has a few line of code in it. It loads the first external swf on index(0) and then loads another on index(1). The user then interacts with index(1) and it opens up index(2) and maybe even (3) and (4). So now, How can I communicate back with index(0) from (3) or (4)? I can make it reload and stay in order from the base movie, but I can't seem to communicate with it from anything above it.

Copyright © 2005-08 www.BigResource.com, All rights reserved