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








_totalframes Of An External Swf


Hello,

I'm doing this:

loadMovie("intro.swf");

into a MC whose instance name is "holder". That seems to be working fine. But what I want to do now is set variable to however many frames are in "intro.swf". It seems that I would do something like:

the_count = _root.holder.intro._totalframes


...or something. I've tried everything I can think of. Can anyone tell me where I'm going wrong?

Thanks.




FlashKit > Flash Help > Flash ActionScript
Posted on: 08-19-2002, 05:49 PM


View Complete Forum Thread with Replies

Sponsored Links:

Get The _totalFrames Of An External .swf?
Hi, as the title suggests im loading a .swf into a mc using loadmovie, but i need to know when the movie has finished playing. But as the mc on my timeline is only 1 frame it thinks it has reached the end (even though the movie .swf plays till the end)

dropZone is 1 frame but the mc being loaded into it is about 100, but this will be dynamic. Hope that makes sense. Any ideas?


Code:
if (dropZone._currentframe == _totalframes){
gotoAndStop("tester");
}

View Replies !    View Related
_totalframes Of External Swf
Is there a way to get the total frames and current frame of an externally loaded swf? The code I am using below does not work. My _root timeline has three objects: two dynamic text boxes and a container clip. Their instance names are myText_text, myText2_text, and loader_mc, respectively. I have two variables, "i" and "j", which populate myText_text.text and myText2_text.text, respectively.

The problem is that the values display "1" because they are getting the value of the container clip and not the movie loaded into the container clip. I need the _totalframes and _currentframe properties of the externally loaded clip, not the container clip. My code below doesn't work. Any ideas?


Code:
_root.loader_mc.loadMovie("loadedclip.swf");
var i = _root.loader_mc._totalframes;
var j = _root.loader_mc._currentframe;
_root.myText2_text.text= j;
_root.myText_text.text = i;
stop();

View Replies !    View Related
Getting The _totalframes Of An External SWF
Hi all,

I have a movie loading in a number of external SWF's.

It Gets the total number of SWF's from a PHP script and then.

It needs to load the first SWF and then when it has reached it's end it needs to load the next SWF file.

The catch being that the external SWF's can contain no actionScript!

I have tried this code:

stop();

currentFile = 0;
loadMovieNum( "banners/banner" + currentFile + ".swf", 2);

_global.end = function() {

number_txt.text = currentFile;
loadMovieNum( "banners/banner" + currentFile + ".swf", 2);
myTf = _level2._totalframes;


// myMovie is an empty MC on the stage
myMovie.onEnterFrame = function(){

myCf = myMovie._currentframe;

if (myCf == myTf){
_global.end();
}

}
currentFile = (currentFile + 1 < Number(fileCounter.files)) ? currentFile + 1 : 0;
};

fileCounter = new LoadVars();
fileCounter.onLoad = end;
fileCounter.load("filelist.php"); // gets the number of swf's in directory

I cannot get the totalframes of any of the external SWFs...

Anyone have any ideas?

I'm beat!

Nice one,

Neb

View Replies !    View Related
_totalFrames Property Of External Movies?
I´m having problems with _totalFrames.
I´m trying to build a music player using flash. The songs that I´m using for the player are all external .swf´s that load when the user requests it.
I´m trying to build a display that shows the time of the current song(minutes, seconds,etc.) and I´m having problems accessing the _totalFrames property of the loaded movieclip.
I´m able to use trace() to get _totalFrames, but I´m having problems attaching _totalFrames to a variable. I´m loading the external .swf´s into level2 of my movie.

this works and I get a value in the output window:
trace (_level2._totalFrames);

but this doesn´t work
totalFramesOfSong = level2._totalFrames;

Any Ideas? Is this possible?

thanks
S.G

View Replies !    View Related
_totalFrames
Hey guys and gals

Is it possible to return the value of the total frames within a scene?

I know you can do it for the total movie but i need to do it by scene.

Any ideas?

Steve

View Replies !    View Related
_framesloaded >= _totalframes?
_framesloaded >= _totalframes is the condition in the preloader showed by the reference. My question is how can _framesloaded ever be bigger than _totalframes?


And another question: how can I stop animation in a symbol?
I want the clip to play only once during a movie/layer, yet I want to continue to display the symbol at the last keyframe.

View Replies !    View Related
Changing _totalframes
Can anyone recommend how to change the "_totalframes" portion in this script to either read a percentage (10%) or a specific frame (60)?

if (_framesloaded>=_totalframes) {
gotoAndPlay (2);
} else {
gotoAndPlay (1);
}

I've tried:

if (_framesloaded>=60) {
gotoAndPlay (2);
} else {
gotoAndPlay (1);
}

if (_framesloaded>=10%) {
gotoAndPlay (2);
} else {
gotoAndPlay (1);
}

But neither way is working.

Thanks!

View Replies !    View Related
Checking _totalframes ?
hi all, i dont know what's going on but i'm stuck on something really simple:

i want to check if a small tween within an MC has played and perform a function only if its at _totalframes??


ActionScript Code:
var _playing = (nav_devMC.?? < nav_devMC._totalframes)
    if (nav_devMC._playing == nav_devMC._totalframes) {
        //fadeIn();
        trace("nav_devMC loaded "+nav_devMC._totalframes)
}
any thoughts on this much appreciated.

View Replies !    View Related
Trying To Get _totalframes Of Several Swf Files
Hello folks,

I have a list of swf files and I need to know the amount of frames of each one of them. I tried the following:

1. I created a xml file called "data.xml" (an example with 5 files - lesson1.swf, lesson2.swf, lesson3.swf, lesson4.swf and lesson5.swf):
<?xml version="1.0" encoding="iso-8859-1" ?>
<course>
<lesson id="1"><name>lesson1</name></lesson>
<lesson id="2"><name>lesson2</name></lesson>
<lesson id="3"><name>lesson3</name></lesson>
<lesson id="4"><name>lesson4</name></lesson>
<lesson id="5"><name>lesson5</name></lesson>
</course>

2. I wrote this script on Flash:

System.useCodepage = true;
var MyXML:XML = new XML();
MyXML.ignoreWhite = true;

MyXML.onLoad = function($sucess){
if($sucess){
for($i=0; $i<MyXML.firstChild.childNodes.length; $i++){
lessonloaded = MyXML.firstChild.childNodes[$i].firstChild.firstChild.nodeValue;
loadMovieNum (lessonloaded + ".swf", 10); // loads lessonn.swf on _level10
_level10.stop();
trace (_level10._totalframes);
unloadMovieNum (10);
}
} else {
trace($sucess);
trace("Error!");
}
}
MyXML.load("data.xml");

The trace (_level10._totalframes) command results in undefined five times. So I tried the onEnterFrame function, believing that after some loops Flash would recognize the amount of frames of the lessonn.swf file loaded on _level10:

for($i=0; $i<MyXML.firstChild.childNodes.length; $i++){
lessonloaded = MyXML.firstChild.childNodes[$i].firstChild.firstChild.nodeValue;
loadMovieNum (lessonloaded + ".swf", 10);
_level10.stop();
onEnterFrame = function(){
if (_level10._totalframes != undefined) {
trace (_level10._totalframes);
unloadMovieNum (10);
delete this.onEnterFrame;
}
}
}

But, onEnterFrame function is invoked just once, after the loading of lesson5.swf. So I get the amount of frames of the last file only.

Now, I'm a little bit lost... I don't know what to do to improve this script, and I'm wondering if there isn't a better way to get the _totalframes of a list of swf files...

Any suggestions will be very appreciated!

Thanks in advance,
Zenho

View Replies !    View Related
Problem With _totalframes
Hi I'm having a nasty problem with this actionscript thing. I'm loading an external mc into this empty movieclip:


Code:
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
logo_mc.createEmptyMovieClip("container_mc",0);
logo_mc.container_mc.loadMovie("load.swf");
This works perfectly, the swf is loaded and all the content is displayed correctly. But now I want to get the totalframes of this movieclip (I know there are 8 frames in the movie, but it should detect this automatically)

Do do this I tried this code:


Code:
trace(this.logo_mc.container_mc._totalframes);
Now Flash returns 1, while it should return 8. I know the path is correct, otherwise Flash should return undefined.
What am I doing wrong?

Thanks in advance,
Tijs

View Replies !    View Related
Can I See _totalframes On A Loaded Swf?
Hey guys!

I have a program where I am supposed to first load a swf in the first frame (i will not know how long that swf is), and when that has finished playing the main program i supposed to move on to the next frame. Now my question is, can I somehow figure out how long that swf is from within my main program or will I have to put a simple _root.gotoAndPlay(2); in the last frame of my loaded swf?

Thanks for looking!
/Joel

View Replies !    View Related
Problem With _totalframes
Hi I'm having a nasty problem with this actionscript thing. I'm loading an external mc into this empty movieclip:


Code:
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
logo_mc.createEmptyMovieClip("container_mc",0);
logo_mc.container_mc.loadMovie("load.swf");
This works perfectly, the swf is loaded and all the content is displayed correctly. But now I want to get the totalframes of this movieclip (I know there are 8 frames in the movie, but it should detect this automatically)

Do do this I tried this code:


Code:
trace(this.logo_mc.container_mc._totalframes);
Now Flash returns 1, while it should return 8. I know the path is correct, otherwise Flash should return undefined.
What am I doing wrong?

Thanks in advance,
Tijs

View Replies !    View Related
Load NOT _totalframes
This is what we are familier with....

Code:
var loadAmount = _totalframes;
if (_framesloaded == loadAmount) {
gotoAndPlay("ShowTime");
}
but what needs to be if I want to load only 30 frames out of 300 and play the movie?

View Replies !    View Related
_totalframes And SWF Problems
Is there a way to get the total No. of frames from an SWF been loaded inside another main SWF ?

I don´t want to put any code inside the loaded one, everything must be handled by the main SWF.

I tried to use _totalframes and a holder movieclip, but it always return
the n. of frames from the holder, not the loaded one.

Is there any sollution to this ?

Thanks !

View Replies !    View Related
Finding _totalframes For A Scene...?
Does anyone know if it's possible to find the _totalframes or totalbytes for a scene. I know it's available for the entire movie, but what i would like to do is create a percentage bar preloader for each transition into a scene.
It would work something like this...
Scene1 -> Scene2Preloader%Bar -> Scene2 -> Scene3Preloader%Bar -> Scene3 -> etc.
I'm open to any suggestions... thanks!

View Replies !    View Related
Why Does _currentframe == _totalframes When I Load An Mc?
Hello everyone

I have an mc that on a clipEvent LoadFrame I have an if statment that compare the _currentframe to the _totalframes. When currentframes == _totalframes I want an action to occure. The action always occures when the mc is loaded. WHy is this????? How can the current frame be at the end. DOes any one know why??

Thank you all in advance.

onClipEvent (enterFrame) {
if ( _currentframe == _totalframes) {
do the following;
}
}

View Replies !    View Related
_totalframes On Loaded Movie?
I'm working on an EXE which loads video SWFs into a movie clip called vidScreen. I'm trying to automate my video fade ups and downs using vidScreen._alpha. I've got the fade ups working no problem. However, for the fade downs (at the end of the video clips), I need to calculate "vidScreen._totalframes" (so that I can start and end the fades on the appropriate frames). vidScreen._totalframes returns the number of frames in the original movie clip, however, not the number of frames of the SWF loaded into it. I see that loadMovie has "get" & "post" variable parameters, but that only works with HTML pages, correct? Is there any way to communicate the _totalframes of a loaded SWF to its parent movie clip?

Thanks in advance for any help.

View Replies !    View Related
Is There A Way To See How Many Frames Are In A Scene? (not Using _totalframes)
I'm doing some video work up in flash and I have the section broken off into 4 scenes. Everything works fine for a little bit and then it just gets really out of sync progressively.

My problem is that the component that I'm using to control the video uses _totalframes instead of detecting the amount of frames in the current scene. When I test each scene independently the syncing is perfect so I know that it has something to do with the fact that the long video is messing things up.

Does anyone have a quick work around for this as I'm in a pretty tight spot now.

Thanks

View Replies !    View Related
_totalframes Problem When Used With MovieClipLoader
Hi there,

I'm having a problem with using _totalframes (and also _currentframe) to control a movieclip that I've loaded using the MovieClipLoader class.

I have a holder mc ("_root.contentClip") that I'm loading a .swf into (in this case, I'm loading "1.swf").

I also have a button with a trace function to determine _totalframes of "contentClip". When I use this button to determine _totalframes of contentClip before loading anything, it works fine, returning a number of "80". However, after loading the .swf, it will only return "1" (even though there are 600 frames in "1.swf")

Incidently, the myMCL.onLoadInit function traces "_level0.contentClip" - I've tried using this filepath to access the movie clip, but it doesn't work either.

Any help would be appreciated.

Source code below:


Code:
stop();

var myMCL = new MovieClipLoader();

myMCL.onLoadProgress = function (targetMC, loadedBytes, totalBytes) {
_root.total = totalBytes;
_root.loaded = loadedBytes;
}

myMCL.onLoadInit = function (targetMC) {
trace ("Movie clip:" + targetMC + " is now initialized");
}

function loadSection (contentNo:Number){
var contentName:String = (contentNo+".swf");
myMCL.loadClip(contentName,"_root.contentClip");
index=contentNo;
}

navigation.section1Button.onRelease = function(){
loadSection(1);
}

testButton.onRelease = function(){
trace(_root.contentClip._totalframes);
}
Thank you to anybody who can help.

View Replies !    View Related
_totalframes Doesn't Work In AS 3.0
How do I get _totalframes of a movieclip? I want to go to a random frame based on how many frames there are total.

in AS 2.0 you could do


Code:
gotoAndStop(random(_totalframes)+1);

In AS 3.0 I tried


Code:
var whatFrame:int = Math.random() * _totalframes + 1;
But it gives me an error.

I'm doing this inside a class.

I set the linkage for a movieclip so it looks like...

Class: com.game.BadGuy
Base Class: flash.display.MovieClip

BTW: why do you need a "Base Class" if I'm already extending movieclip in the BadGuy class anyway?

Anyway here's the error I get

1120: Access of undefined property _totalframes.

So how can I get that?

Thanks in advance...

Here's my code from my class in case you want to see the whole thing.


Code:
package com.game
{
import flash.display.MovieClip;
public class BadGuy extends MovieClip
{
public function BadGuy()
{
var whatFrame:int = Math.random() * _totalframes + 1;
gotoAndStop(whatFrame);
trace("I'm here");
}
}
}

View Replies !    View Related
_totalframes Count In MC In Library
It is possible to check the number of frames in a movieclip that is in the library or must I use attachMovie(); before I can do it? I would like to be able to not load it before I need it.

View Replies !    View Related
Read _totalframes From LoadMovie
Hello,

Ik have a player and a movie both .swf files.
the movie is loaded in the player with loadMovie.

I want to read the _totalframes from the movie and show this in the player with a timeline.

I have it working in the movie but there i have percent shown.
Code from the movie

Code:
var nTotalFrames:Number = this._totalframes;
//frames.text = nTotalFrames;
onEnterFrame = function() {
var loader = Math.round((this._currentframe / this._totalframes)*100);
pecent_txt.text = loader+"%";
}
how can i put this in the player?

View Replies !    View Related
Movieclip - _currentframe | _totalframes
Hi!

I have use that code when someone press on a button.
First i start a movieclip - start_hide

I check with if(), if the movieclip has been finished and if it has finished, the visitor will be sent to a fram that is named - tjanster.

NOW

MC - start_hide, starts but i never comes to "tjanster", so i think the if(), it's wrong,

I'm just a beginner so I think I did a "easy" wrong but please help me!


Code:
on(release) { _root.start_hide.gotoAndPlay(1); if(_root.start_hide._currentframe == _root.start_hide._totalframes) { _root.gotoAndPlay('tjanster'); }

View Replies !    View Related
_totalFrames And Externally Loaded Swfs.
Im working on a cd-rom application in Flash for my portfolio which will feature heavy video (enhanced music cd)

Using Sorenson Squeeze I have exported mpeg video directly to a swf.
I have about 10 swfs and each are circa 30mb.

As such they are brought in using loadMovie when requested and attached to movie_mc (a placeholder).

Because I used sorenson I have no ability to add functions (preloader to pass back a totalFrames variable to the main timeline)to these external swfs.

I need to determine the totalFrames in a loaded swf in order to determine when it has finished playing so that it can be replaced with a standard mc.

using a combination of this code:


Quote:




enteredTrack = audioFields_mc.songInput;
loadMovie("musicVids/"+enteredTrack+".swf", moviePlayer_mc.movie_mc);
dynamicTitle = enteredTrack+".swf";
dynamicTitleFrames = moviePlayer_mc.movie_mc.dynamicTitle._totalframes;




Im having no luck.
I know for a fact that this line is wrong
moviePlayer_mc.movie_mc.dynamicTitle._totalframes;
and it is infact reading "dynamicTitle" as part of the path instead of adding its value to the path. How to fix this, I dont know.

Im also concerned that requesting the _totalframes immediately after loading the video in wont work because it will not be fullyloaded from the CD when the function is called.

Help!

View Replies !    View Related
_totalframes Is Larger Than My Number Of Frames
I have an MC with exactly 4 frames showing in the timeline. However, _totalframes reports 16 frames!

I tried selecting (in the Flash 8 Prof. GUI) those "virtual" non-existing frames and deleting them, by selecting a number of frames after my 4th frame (although they already show up empty). HOwever, I seem to be getting even more, yesterday I only had 3 frames more visible, today it's 12...

Is it possible frames once created in the GUI are never deleted? Anyway, how do I get those non-visible (in the GUI) frames deleted?

UPDATE: Just found out when I select "Select all frames" from the timlines context menu those unwanted additional frames are selected, so this way I now CAN see how many there really are. Still, attempting to delete them is unsuccessful!

ANOTHER UPDATE: I just selected all those additional frames in the GUI (first made visible using the above method), and converted them to "real" frames. Now I ended up with even more non-existing and unwanted frames, my timeline now had 80(!!!) frames when I selected "select all frames"!!!





























Edited: 04/30/2007 at 06:19:24 AM by Hasenstein

View Replies !    View Related
[F8] LoadMovie Causes Different _totalframes Compared To Same File From Library
Using AS2


If I do

a=r.attachMovie("library.x.swf","a",pile());

then a._totalframes == 222

If I do the same thing but then load a movie after

a=r.attachMovie("library.x.swf","a",pile());
a.loadMovie("x.swf"); //actually the very same file stored locally!

I get

a._totalframes == 4500


What's the deal?

View Replies !    View Related
[Dare] Find _totalframes Of SWF Loaded Via LoadClip(): Is It Possible?
Can someone post an example of how one would get _totalframes of a multi-frame swf loaded via MovieClipLoader/loadClip()?

I do not think it is possible. But, then again, I am noob... please prove me wrong.

View Replies !    View Related
Problem With External MCs, Loading An External Into An External
What I have is 2 seperate files, Main file is the actual website flash, second file is the external movie clip that loads 3 other external movie clips. The site will see the external clip but nothing will appear on the site, blank movie clip only.

On the main site there is this code to load the external clip into the site:


ActionScript Code:
loadMovie("toonsext.swf", _root.toons_mc)


On the external clip these are the codes for loading the 3 characters onto it:


ActionScript Code:
loadMovie("joshtoon.swf", joshblank_mc)loadMovie("toonmatt.swf", mattblank_mc)loadMovie("metoon.swf", meblank_mc)


Seperately the external clip will work and show the characters however on the main site it will not show anything. What could be the problem can flash not load 2 seperate entities like this or is there a code wrong on my behalf?

View Replies !    View Related
Load External Text Inside An Already Loaded External Movie
here's the problem as simply as I can explain it.
there's a main.swf, a news.swf and a text.txt
the news.swf is loaded into the main.swf and I want to load the text.txt into the news.swf

everything works when I just load the text into the news.swf without loading it into the main.swf, so I know the text.txt part is loading.

View Replies !    View Related
[F8] External Text Files Wont Load Into External Swf File...
Hi,

I'm making a Flash website in Flash 8 (mac).

Structure: There is 1 main file that loads external SWF files depending on what is clicked on.

One of the external SWF files loads its text from external text files. This works fine when viewing the SWF applet on its own. But when viewing as a whole site, the text doesnt appear. Very annoying.

I made that particular SWF on my mums computer running Flash MX 2004. The flash file itself uses the Scrollbar component from MX.

Could someone tell me why the text doesnt load in this scenario? It runs fine on its own, just not as an external SWF.

I've attached the files in question. Its a 200kb ZIP download. Do tell me if you need to know more.

Thanks

View Replies !    View Related
How To Load An External Movie Using A Link Within An External Swf - Urgent
Hi all

Flash CS3 but coding in AS2 - mac.

I believe I have asked this question before but i was using loadMovie() - I am now using loadClip and the MovieClipLoader class and obviously I have managed to break something.

I have a number of external swfs which load fine, with preloaders using MovieClipLoader, into an empty MC on the stage called holder_mc. In one of the external swf's, there are two links to separate external swf's - if you click on either of them, the current swf is unloaded and the new one is loaded. I used:


Code:
myButtonWithinSwf.onRelease = function() {
this._parent.loadMovie("newMovie.swf");
}
However now that I am using a different code (because before, evrything wasnt preloaded, i just had a white space until it appeared) the code within the swf obviously has to change. The only problem is, I cant for the life of me work out what it is, I have tried all sorts of combinations and probably missed the most obvious one. I do not want to create empty movie clips, I want the movie to load into the MC which I have defined - holder_mc - and usually I would tell it to unloadClip() before loading the new one, but it cant load a new one if it has unloaded itself. I hope that makes sense!
This is the code I am using on the main timeline to control the preloading of the external swf's:


Code:
var mcLoader:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
loadListener.onLoadStart = function() {
holder_mc.stop();
};
loadListener.onLoadProgress = function(target:MovieClip, loadedBytes:Number, totalBytes:Number) {
pleaseWait._visible = true;
var preloaded:Number = Math.floor(loadedBytes / totalBytes * 100);
preloaderMC._visible = true;
preloaderMC.loadText.text = preloaded.toString() + "%";
preloaderMC.loadBar._yscale = preloaded;
};
loadListener.onLoadInit = function() {
preloaderMC._visible = false;
pleaseWait._visible = false;
holder_mc.play();
};

/**** register listener object with MovieClipLoader object ****/
mcLoader.addListener(loadListener);

anotherButton.onRelease = function() {
mcLoader.unloadClip(holder_mc);
mcLoader.loadClip("anotherMovie.swf", holder_mc);
}
my preloader is called preloaderMC and pleaseWait is just a movie clip that is placed on the other side of the screen for another reason. loadText and loadBar are the dynamic text and loading bar within the preloaderMC.

I really hope someone can help me ASAP as this was all working before with loadMovie() and now suddenly I cant get it working!

Thanks in advance

Theo

View Replies !    View Related
Load External Swf From Html Formatted External Text?
Hi to all,

new to this forum, not so new to flash, but deeper AS...

I searched a while before asking now but didn#t found a solution for what i want to do.

may be someone can give me a hint to this:

I have a html formatted external text file and i want to call from this a external swf movie like

Code:
<a href="loadMovieNum("products.swf",10)">products</a>
I guess i need a asfunction for this?

So i read this:
http://www.macromedia.com/cfusion/kn...fm?id=tn_15639

But still get not the trick how to..?

I tried this:
in 1. Frame of movie i placed:

Code:
function myFunction () {
loadMovieNum("products.swf",10);
}
and changed html text in:

Code:
<a href="asfunction:myFunction">products</a>
when i publish and add a trace function is still got the comment i gave in trace but external swf is not loaded.
I get no error in output window, but not loaded.

Any ideas or hints?

Would be great.

Thank you for a hint.

all best
cyrano

View Replies !    View Related
Preloader For External Swf That Pauses External Swf Until Completely Loaded
I'm fairly new to all of this stuff, so bear with me . . .
I want to load an external swf into a main swf movie. (This much I can do).

I would like a separate preloader movie in the main swf movie to display the amount loaded.(I've found tutorials for that, so that's not the issue.)

The problem is that I want the external swf not to start playing until it is completely loaded.

If I put a stop on the first frame of the external swf, that will keep it from playing, but, I'm not sure how to get the external swf to recognize that the load is complete.

I could put a preloader in the external swf, but I'm trying not to so that I can reuse the preloader for other external swf files without having to put it in each one.

Maybe I put a preloader without a visual component on each external swf?

Any help would be greatly appreciated.

Thanks.

View Replies !    View Related
Preloaded External Swf Do Not Show External Dynamic File...?
okeli... I am posting because I am totally stuck... my xp regarding coding and stuff is absolutely crap (although I do understand most logic to the scripts u all write out), so I have followed most of ur tutorials on the site.

The problem:

I have made a main file and used primarily two of ur tutorials together. The first one is Claudio's Preloader and transition tutorial, http://www.kirupa.com/developer/mx/p...transition.htm, but also kirupa's Scrolling dynamically loaded text, http://www.kirupa.com/developer/mx/dynamic_scroller.htm.

The file main.swf should load, with transition and loading, the file members.swf - which it does. However when members.swf should load currentmembers.asp as a scrolling text the text do not show up. When I however view members seperately the scrolling text DO SHOW up! I am all confused at this and the only thing I can imagine being wrong is somewhere in the coding of main.fla file... :/ Perhaps I am wrong (which would not be a surprise) so if someone kind enough can have a look through at the coding of the main.fla and/or members.fla I would be sinceraly grateful... thanks...

The files:
http://www.sebszhost.com/~leete/FftC/currentmembers.asp
http://www.sebszhost.com/~leete/FftC/main.fla
http://www.sebszhost.com/~leete/FftC/members.fla

View Replies !    View Related
Loading External SWF From External SWF Onto An Empty MC On Main Timeline?
Hi Everyone,

Please bear with me while I explain. I have an external swf that loads into a frame in the main timeline, into an empty MC. I can do this just fine. Once this clip is loaded, I have a button in this clip that loads another external swf into a different empty MC on the main timeline. I'm using loadMovie, and I need to load these movies into specific empty MCs. In other words,

I have the following:

MainStage: frame 5, contains empty MC "ClipA"; frame 6, contains empty MC "ClipB"
External swf: "Movie1"
External swf: "Movie2"

"Movie1" goes into "ClipA" of frame 5 on Main Timeline; and "Movie1" has a button that loads "Movie2" into "ClipB" of frame 6 on Main Timeline. I need help loading "Clip B" into "Movie2" from a button in "ClipA."

I'm sorry my message is so roundabout - it's not really a complicated situation, but explaining it makes it seem so.

Thank you in advance for any help - I'm assuming it's some sort of _root or _parent issue things I'm not quite understanding.

Thanks!
macgirl

View Replies !    View Related
Trigger External Swf To Load Into Main Swf From Button In Another External Swf
I'm really stuck with this and it seems like such a simple problem to solve.

I am trying to get a nav button in one movie (main_nav.swf) to target a my main movie (index.swf) and load a sub nav movie (metals_subnav_infinite.swf) into it. The sub nav movie will do a similar task - loading a portfolio swf into main movie (index.swf).

Here is the file breakdown of my working files:

index.swf - main final movie which loads "main_nav_infinite3.swf" on start

main_nav_infinite3.swf - loads main nav "main_nav.swf" and scrolls it infinitely (infinite menu)

main_nav.swf - main nav with buttons that trigger sub nav "metals_subnav_infinite.swf" to load into index.swf

metals_subnav_infinite.swf - loads sub nav "metals_subnav.swf" and scrolls it infinitely

metals_subnav.swf - sub nav with buttons that trigger "folio.swf" (have not created this file yet!) to load into "index.swf"


The script I was focusing on is in main_nav.fla and it is:

metals_mc_bn.onRelease = function() {
reActivateMenu();
this.gotoAndStop(3);
this.enabled = false;
_level1.sub_nav_content_mc.loadMovie("metals_subna v_infinite.swf");
};

I haven't yet activated all the buttons yet just the "Metals" button as the first to get working.

I have attached the FLAs.


exxie!

View Replies !    View Related
How To Load An External Movie Using A Link Within An External Swf - Urgent
Hi all

Flash CS3 but coding in AS2 - mac.

I have asked this question before but i was using loadMovie() - I am now using loadClip and the MovieClipLoader class and obviously I have managed to break something.

I have a number of external swfs which load fine, with preloaders using MovieClipLoader, into an empty MC on the stage called holder_mc. In one of the external swf's, there are two links to separate external swf's - if you click on either of them, the current swf is unloaded and the new one is loaded. I used:


Code:
myButtonWithinSwf.onRelease = function() {
this._parent.loadMovie("newMovie.swf");
}
However now that I am using a different code (because before, evrything wasnt preloaded, i just had a white space until it appeared) the code within the swf obviously has to change. The only problem is, I cant for the life of me work out what it is, I have tried all sorts of combinations and probably missed the most obvious one. I do not want to create empty movie clips, I want the movie to load into the MC which I have defined - holder_mc - and usually I would tell it to unloadClip() before loading the new one, but it cant load a new one if it has unloaded itself. I hope that makes sense!
This is the code I am using on the main timeline to control the preloading of the external swf's:


Code:
var mcLoader:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
loadListener.onLoadStart = function() {
holder_mc.stop();
};
loadListener.onLoadProgress = function(target:MovieClip, loadedBytes:Number, totalBytes:Number) {
pleaseWait._visible = true;
var preloaded:Number = Math.floor(loadedBytes / totalBytes * 100);
preloaderMC._visible = true;
preloaderMC.loadText.text = preloaded.toString() + "%";
preloaderMC.loadBar._yscale = preloaded;
};
loadListener.onLoadInit = function() {
preloaderMC._visible = false;
pleaseWait._visible = false;
holder_mc.play();
};

/**** register listener object with MovieClipLoader object ****/
mcLoader.addListener(loadListener);


anotherButton.onRelease = function() {
mcLoader.unloadClip(holder_mc);
mcLoader.loadClip("anotherMovie.swf", holder_mc);
}
my preloader is called preloaderMC and pleaseWait is just a movie clip that is placed on the other side of the screen for another reason. loadText and loadBar are the dynamic text and loading bar within the preloaderMC.

I really hope someone can help me ASAP as this was all working before with loadMovie() and now suddenly I cant get it working!

Thanks in advance

Theo

View Replies !    View Related
Preloader For External Swf That Pauses External Swf Until Completely Loaded
I'm fairly new to all of this stuff, so bear with me . . .
I want to load an external swf into a main swf movie. (This much I can do).

I would like a separate preloader movie in the main swf movie to display the amount loaded.(I've found tutorials for that, so that's not the issue.)

The problem is that I want the external swf not to start playing until it is completely loaded.

If I put a stop on the first frame of the external swf, that will keep it from playing, but, I'm not sure how to get the external swf to recognize that the load is complete.

I could put a preloader in the external swf, but I'm trying not to so that I can reuse the preloader for other external swf files without having to put it in each one.

Maybe I put a preloader without a visual component on each external swf?

Any help would be greatly appreciated.

Thanks.

View Replies !    View Related
External Clip, External Variables Don't Load
hi all,

I'm having some trouble with external variables and external movie clips. I have a main movie, and one part of it is an external movie, the main movie has a bunch of variables stored in a text file. This works fine. The external movie also has a bunch of variables in a different text file. When I play the external movie on it's own it works fine too. When I load the external movie from my main movie, the movie loads but the variables don't. Is there a special way to do this with more movies, do I have to load variables on different levels or something?

I generally use this to load variables

loadVariables ("roznet.txt", "");

I have tried using absolute paths as well (http://) but the same thing. It works by itself but when it is within my main movie the variables don't load. Any ideas? Thanks.

View Replies !    View Related
How Can I Load External JPEG From External File?
I know I should read manual.., but I don't have now.
So please someone help me.
I am trying to load JPEGS from external file into MC.

View Replies !    View Related
Loading External Swf Which Load External Txt File
Hi,
My main movie loads an external swf with the following:
code:
createEmptyMovieClip("contRight_mc", 5);
contRight_mc.loadMovie("contHome.swf");
contRight_mc._x = 485;
contRight_mc._y = 0;


contHome.swf loads an external text file and stylesheet:
code:
loadVariablesNum("contHome_no.txt", 0);

globalStyle = new TextField.StyleSheet();
globalStyle.load("global.css");
hdrHome00_txt.styleSheet = globalStyle;


hdrHome00_txt is a dynamic text field with the variable hdrHome00, which is used in the loaded text file:

hdrHome00=<html><body><hdr>text</hdr></body></html>

All files are currently in the same directory. When I test contHome.swf (the swf loaded by the main movie), everything works. But when I test the main movie the text does not load, or at least it does not show up as I receive no errors in the output window, and I can't figure out why. Can anyone help?

View Replies !    View Related
Generic Preloader For External Swfs From Within An External Swf
Hi,

I have a full flash site that has a main interface.swf that loads in external swf's as holders for their relevant page contents. E.G. using loadMovie I load portfolio.swf into the mainLoader (movieclip) within interface.swf. Within portfolio.swf I load in a further series of external swf's based on button click events, for these I want to use a generic preloader to prevent having to put a preloader in each individual swf.

I have found some code on O'Reilly (http://web.oreilly.com/news/action_0501.html) which seems to offer what I need but I'm having problems implementing this, I'm pretty sure this is down to incorrect targeting due to the fact I am not preloading from _root.

This is what i've been working with:

code:
// ON THE MC I'M LOADING INTO
onClipEvent (enterFrame) {
// If the host clip contains an external .swf file...
if (this._url != _root._url) {
// ...call our preload() function, which displays the
// loading .swf file's download progress.
_parent.preload(this);
}
}

// AND THE PRELOAD FUNCTION ITSELF
function preload (theClip) {
if (!theClip.doneLoading) {
// If we have all the frames, make a
// note that download is complete.
if (theClip._framesloaded > 0
&& theClip._framesloaded == theClip._totalframes) {
theClip.doneLoading = true;

// Optionally start the clip once it's done loading...
// theClip.play();
} else {
// Optionally pause the clip until it's loaded...
// theClip.stop();
}

// Display loading byte counts in text fields.
bytesLoadedOutput = theClip.getBytesLoaded();
bytesTotalOutput = theClip.getBytesTotal();

// Strip out the file name of the .swf loading into the
// clip and display it in a text field.
var lastSlash = theClip._url.lastIndexOf("/");
clipURLOutput = theClip._url.substring(lastSlash + 1,
theClip._url.length);

// Set the width of the loading bar.
var percentLoaded = (theClip.getBytesLoaded()
/ theClip.getBytesTotal());
preloadBar._width = preloadBarBG._width * percentLoaded;
}
}


When testing the preloader never seems to get started, my movies just play and seem to ignore this code.

Any ideas would be much appreciated.

View Replies !    View Related
Loading External Jpeg Via External Preloader
mx2004

hello all, i have a button which loads an external jpeg from a folder. what i want is to have it so when the command to load the external jpeg is sent, an external preloader preloads it in the placeholder. this preloader will be generic so it can be applied to load before any image selected in any folder, for updating purposes. anyone know where to start with action script, or how to set it up,

View Replies !    View Related
External Swf File Does Not Load External Text
Hi,
I have an external text file that loads dynamically in my swf file.
It uses the actionscript:

loadVariables("joblist.txt","_root");

When I play the swf it works perfectly with the text scrolling in the dynamic text field, but when I load this swf file into my main swf file with loadMovie, the text does not appear.
I have tried embedding the fonts in both files, but it still does not show up when loaded into the main movie.
Can anyone help me with this?

View Replies !    View Related
Loading External Html Files With External Css Please Help
Hi people,
I'm new to this forum and new to ActionScript. I have not worked on AS1 or AS2 before so I just got started on AS3.

I'm trying to learn ActionScript 3 and I started experimenting with ideas and workinf examples.

What I'm trying to achieve is a website where the content shown is from external HTML files and external CSS.

My code was working up until trying loading the CSS. The error that I'm getting is "Call to a possibly undefined method URLLoader"

here is my code:


ActionScript Code:
import flash.display.MovieClip;
import flash.text.*;
import fl.transitions.*;
import fl.transitions.easing.*;


var bodyTextField:TextField = new TextField();
bodyTextField.x = 50;
bodyTextField.y = 300;
bodyTextField.width = 500;
bodyTextField.multiline = true;
bodyTextField.wordWrap = true;
bodyTextField.autoSize = TextFieldAutoSize.LEFT;
bodyTextField.selectable = false;

var textBox_mc:MovieClip = new MovieClip();

showContent("html_pages/home.html");

function showContent(paraString:String):void
{

    var contentPage:String = paraString;
   
    var myURLLoader:URLLoader = new URLLoader();
    var myURLRequest:URLRequest = new URLRequest(contentPage);
   
    var myCSSLoader:URLLoader = new URLloader();
    var myCSSRequest:URLRequest = new URLRequest("html_pages/demo.css");
   
    myCSSLoader.load(myCSSRequest);
    myURLLoader.load(myURLRequest);
   
    //myURLLoader.addEventListener(Event.COMPLETE, dataOK);
    myCSSLoader.addEventListener(Event.COMPLETE, dataOK);
   
   
    function dataOK(myevent:Event):void
    {
        var css:StyleSheet = new StyleSheet();
        css.parseCSS(URLLoader(evt.target).data);
        bodyTextField.styleSheet = css;
   
        bodyTextField.htmlText = myURLLoader.data;
   
        textBox_mc.addChild(bodyTextField);
        stage.addChild(textBox_mc);
       
        var myTransitionManager:TransitionManager = new TransitionManager(textBox_mc);
        myTransitionManager.startTransition({type:Wipe, direction:Transition.IN, duration:0.5, easing:None.easeOut});
    }
}

Can someone please have a look and tell me what I'm doing wrong? Thanks.

View Replies !    View Related
Help With External Swf To External Swf Interactivity Along Same Timeline Help Needed
I'm structuring a website in Flash MX 2004, using a main timeline with empty movie clips along the timeline which load external swf files at frame labels corresponding to my main navigation. All is working fine, until I try to link to a specific frame label in one externally loaded swf from buttons in another externally loaded swf on a different location in the timeline. I tried setting a variable in the swf when the button is pressed to true, and placing an if statement in the beginning of the linked-to swf that said if varname is true, then go to the specific frame label. Has anyone ran into problems linking external swf to external swf? Anyone have good references for passing variables? I know the if/else is good, I think the problem is that the variable isn't passing correctly. Should I be using global variables? Linking to an external text file with variables? Creating an event listener? Any references/help are extremely appreciated!!!

View Replies !    View Related
Loading External Swf, From A Previously Loaded External Swf.
I'm trying to figure out if its possible to have a page that loads an external swf (easy, know how to do that), but then, from clicking on a button thats inside that loaded swf, load a different external swf in its place. Any ideas?

View Replies !    View Related
Disable Button In External Swf From Diff. External Swf
ok, i am loading an external swf into the main movie, and i want to disable the buttons and movieclips underneath while the movie is loaded. i am using a function, defined on root timeline to disable buttons.
ex:

ActionScript Code:
function butEnable(check) {    _root.rap.enabled = check;    _root.web.enabled = check;}


it works beautifully and sucessfully disables most of the buttons and mcs underneath.
however, it doesn't work for disabling the buttons that are in external swfs loaded under the top external swf. i'm sure i'm targeting it right. is this just not possible? or do i have to do something different?

~thanks

View Replies !    View Related
External Text In External Swf Not Loading In Main Swf
Hi. I'm kind of new to Flash, and am trying to make external text load into an external swf which is loaded into my main swf.

What I have is a swf file where I have buttons that load external text. I then loaded this swf into another main.swf and now the external text will not load. The code i have in the external.swf to load external text is this


but4272005.onRelease=function(){
loadVariablesNum ("4272005.txt","0");
}
but4282005.onRelease=function(){
loadVariablesNum ("4282005.txt","0");
}
but532005.onRelease=function(){
loadVariablesNum ("532005.txt","0");
}


This swf works by itself, but when i load it into the main.swf it doesn't.
I'm sure it has something to do with the "0", but I'm not sure what to put there to make it load correctly in the main swf.

The dynamic textbox i'm trying to load into is named "index_txt". The name of the loader in the main.swf is named "content". Any help would be appreciated.

View Replies !    View Related
Problems Loading An External .swf Inside An External .swf
Hey, I created a site using Kirupa's external .swf loading tutorial. Now in one of my externally loaded .swf's, I am loading another external .swf. I've gotten this to work fine, but the second external .swf (loaded into the first) contains buttons that will swap this second external .swf with another external .swf. I can't seem to get the AS references to the variables set up correctly in order to swap the swf's. It sounds rather confusing, so I've included the .fla's and .swf's below.


The file structure:
-band.swf load's profiles_main.swf
-The buttons in profiles_main.swf are trying to load chris.swf (swapping it entirely with profiles_main.swf)

If anyone has a few moments, I'd really appreciate the help.

View Replies !    View Related
Problems Loading An External .swf Inside An External .swf
Hiya, I created a site using Kirupa's external .swf loading tutorial. Now in one of my externally loaded .swf's, I am loading another external .swf. I've gotten this to work fine, but the second external .swf (loaded into the first) contains buttons that will swap this second external .swf with another external .swf. I can't seem to get the AS references to the variables set up correctly in order to swap the swf's. The initial .swf loads fine, but the button control gets complicated inside it. It sounds rather confusing, so I've included a link to the .fla's and .swf's below.

http://www.rta.ssxh.net/files.zip


The file structure:
-band.swf load's profiles_main.swf
-The buttons in profiles_main.swf are trying to load chris.swf (swapping it entirely with profiles_main.swf)

If anyone has a few moments, I'd really appreciate the help.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved