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




Loading On-top Of Existing Swf (then Unloading Previous Swf)?



Hi

I'm currently building a site with 1 main file, and 4 swfs loading into a Empty Movie container within the main file. An example of the code I'm using (on buttons) to do this is

Code:
on (release) {
loadMovie("Reels.swf", "_root.container");
This works fine, but instead of just replacing the existing swf with the new one, I'm trying to create a transistion where the new loaded swf covers over the exisiting one. I have added a fade/wipe to the start of each external swf, but because they are all loading into the same movie container on the same level, I'm not getting the effect I'm after.
I'm still learning AS, is it possible to load an external swf into the movie container on the next level (to the exisiting one), then after a short time unload the swf in the previous level? As I say, I in the process of learning flash/AS, so any advice is greatly received, even pointing in the direction of a tutorial to learn.

Thanks
Wayne



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 05-09-2007, 10:21 PM


View Complete Forum Thread with Replies

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

[F8] Loading On-top Of Exisiting Swf (then Unloading Previous Swf)?
Hi

I'm currently building a site with 1 main file, and 4 swfs loading into a Empty Movie container within the main file. An example of the code I'm using (on buttons) to do this is

Code:
on (release) {
loadMovie("Reels.swf", "_root.container");
This works fine, but instead of just replacing the existing swf with the new one, I'm trying to create a transistion where the new loaded swf covers over the exisiting one. I have added a fade/wipe to the start of each external swf, but because they are all loading into the same movie container on the same level, I'm not getting the effect I'm after.
I'm still learning AS, is it possible to load an external swf into the movie container on the next level (to the exisiting one), then after a short time unload the swf in the previous level? As I say, I in the process of learning flash/AS, so any advice is greatly received, even pointing in the direction of a tutorial to learn.

Thanks
Wayne

Loading On-top Of Exisiting Swf (then Unloading Previous Swf)?
Hi

I'm currently building a site with 1 main file, and 4 swfs loading into a Empty Movie container within the main file. An example of the code I'm using (on buttons) to do this is

on (release) {
loadMovie("Reels.swf", "_root.container");

This works fine, but instead of just replacing the existing swf with the new one, I'm trying to create a transistion where the new loaded swf covers over the exisiting one. I have added a fade/wipe to the start of each external swf, but because they are all loading into the same movie container on the same level, I'm not getting the effect I'm after.
I'm still learning AS, is it possible to load an external swf into the movie container on the next level (to the exisiting one), then after a short time unload the swf in the previous level? As I say, I in the process of learning flash/AS, so any advice is greatly received, even pointing in the direction of a tutorial to learn.

Thanks
Wayne

Loading Swf On-top Of Exisiting Swf (then Unloading Previous Swf)?
Hi

I'm currently building a site with 1 main file, and 4 swfs loading into a Empty Movie container within the main file. An example of the code I'm using (on buttons) to do this is


Code:
on (release) {
loadMovie("Reels.swf", "_root.container");
This works fine, but instead of just replacing the existing swf with the new one, I'm trying to create a transistion where the new loaded swf covers over the exisiting one. I have added a fade/wipe to the start of each external swf, but because they are all loading into the same movie container on the same level, I'm not getting the effect I'm after.
I'm still learning AS, is it possible to load an external swf into the movie container on the next level (to the exisiting one), then after a short time unload the swf in the previous level? As I say, I in the process of learning flash/AS, so any advice is greatly received, even pointing in the direction of a tutorial to learn.

Thanks
Wayne

Loading Swf On-top Of Exisiting Swf (then Unloading Previous Swf)?
Hi

I'm currently building a site with 1 main file, and 4 swfs loading into a Empty Movie container within the main file. An example of the code I'm using (on buttons) to do this is


Code:
on (release) {
loadMovie("Reels.swf", "_root.container");
This works fine, but instead of just replacing the existing swf with the new one, I'm trying to create a transistion where the new loaded swf covers over the exisiting one. I have added a fade/wipe to the start of each external swf, but because they are all loading into the same movie container on the same level, I'm not getting the effect I'm after.
I'm still learning AS, is it possible to load an external swf into the movie container on the next level (to the exisiting one), then after a short time unload the swf in the previous level? As I say, I in the process of learning flash/AS, so any advice is greatly received, even pointing in the direction of a tutorial to learn.

Thanks
Wayne

Unloading Previous Frame / Component
I'm loading in some pictures from the xml file with some script. And I wanted to unload it at the next few frames cause its lagging. How can I do that?

ActionScript Code:
import com.unic8.media.Scaena;

var mySlideShow:Scaena = new Scaena();
mySlideShow.load(this, "slide1.xml", "effects.xml");

Unloading Previous Frame / Component
I'm loading in some pictures from the xml file with some script. And I wanted to unload it at the next few frames cause its lagging. How can I do that?
ActionScript Code:
import com.unic8.media.Scaena;

var mySlideShow:Scaena = new Scaena();
mySlideShow.load(this, "slide1.xml", "effects.xml");

AS3 - Unloading Previous Frame Functions
Last edited by youwh : 2008-09-01 at 19:59.
























I'm loading in some pictures from the xml file with some script. And I wanted to unload it at the next few frames cause its lagging. How can I do that?


ActionScript Code:
import com.unic8.media.Scaena;
 
var mySlideShow:Scaena = new Scaena();
mySlideShow.load(this, "slide1.xml", "effects.xml");

Problem With Loading New External Mc Before Existing One Has Finished Loading
Hi all,

I've been building a flash website which loads various external movieclips with preloaders into a main movie using either target or level. All is working fine, except when a user clicks on a button to load an external movieclip (the button actually goes to a frame label and then said frame contains the loadmovie action), but then decides to click on another button which loads another movieclip before the original has finished loading. This basically breaks flash, causing the movieclips to start looping erratically (even though I have stop actions in place).

Obviously this problem doesn't occur when I test locally, but please follow this link to see what I mean. Click on the 'locations' or 'recent shoots' sections and then try to load a new movie before an existing one has completely loaded:

http://www.david-vernon.co.uk/365_2/365.html

Now I've experimented with adding 'unloadmovie' to buttons and frames to no avail (though as I'm loading new movies into the same target this shouldn't be the problem surely?), so my only thought is that the preloader actionscript might be causing a problem. Here's the actionscript I'm using on frame 1 of all my external movies:


Code:
stop();
myInterval = setInterval(preloader, 10);
function preloader() {
if (getBytesLoaded() >=getBytesTotal()) {
play();
clearInterval(myInterval);
}
bar._xscale = (getBytesLoaded()/getBytesTotal())*100;
percent.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+"%";
}
I'm not very good with actionscript and I'm really stumped with this, so any help would be greatly appreciated!

Thanks,
Dave

Loading Into Existing MC's
I want to have a movie clip into which I can load and draw different graphics into on runtime. The problem occurs when I want to have a line on frame one and not on frame two. The line is drawn usind the lineto command but it draws a line that it there for all frames. This also occurs when i use the attachmovie command.

Is there a way to select which frames to load into or do i have to draw the lines in another movieclip and hide it on certain frames

Any input would be welcome

Loading Swf's Within An Existing Swf.....?
Hi,

Some time ago i learnt (probably from these boards) that i could load a new separate swf into an existing swf by creating a blank movie in the parent swf and then putting a "blankmovie.loadMovie("aboutus.swf");" action on that blank movie. It works like a treat if you want your navigation to load quickly and then for the main bulk of the info to load when desired into the movie with its own preloader bar etc.

I have however discover a limitation to this. It only seems to work with one blank move and one external swf.

What i want is to do this with multiple external swf's having two or more load into the same scene of the parent swf.

Is this possible? How can it be done?

Basically i gots me a main nav movie into which smaller info movies load when the nav buttons are pressed. But i also want a Swift3D generated movie (i.e. quite large) to load into the main nav movie's window with its own preloader, so that it doesn't slow down the initial load time of the main nav movie.

Di-ya-catch-me-drift?

Hope someone can help......

Loading Another Swf Into Existing One...
OK, I have another question... it may sound stupid to the experts, but please take it into consideration, there are many of us out there who are just starting with all this...

Let's say I have one HTML page, nothing on it, except Flash movie in the middle of the page. Movie is 600x400 pixels large. What I wonder is... when that movie finishes and hits the last frame on the main timeline, I want it to load completely different movie on it's place. The good thing is that another movie that needs to be loaded after the first one is also 600x400 pixels.

Is it possible to load it in the same HTML page, or there is no way, and instead I have to make another HTML page for second movie ?

I know that there is possibility to load movie into existing one, but is there any good soul to explain to me which commands I have to use and also, when second movie is loaded, how can I completely remove the first one from the memory... I'm asking because second movie is pretty large in physical size, and I don't want first move to interfere with second one anyhow...

Thanks in advance !

Loading Swf’s On Top Of Existing Swf’s
Is there any way to load a .swf file on top of another .swf in a way so the original .swf's actions don’t work? In the test .fla that (both need to be published to the same folder) I uploaded when you press the Enter button in test.swf, test2.swf loads on top of test.swf like I want but the navigation buttons in test.swf still work. Is there a way to prevent these buttons from working? Any help/suggestion would be greatly appreciated.

Loading An Existing SWF Into Another SWF
My programmer did this.. but, he's MIA.

Everything works fine.. but, I need to load it into another SWF with the par "container" .. here are the 2 sets of code:

edit: line removed, see post below.
gparis

Cameron

---
stop();

loadVariables(_root.siteURL + "albums.php", );

function checkParamsLoaded()
{
if (!end)
{
}else
{
var len:Number = albums;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.font = "Verdana";
my_fmt.size = 13;
for(var i:Number = 0; i<len; i++)
{
var string:String = "gallery_"+i;
_level0.createEmptyMovieClip(string, _level0.getNextHighestDepth());
_level0[string].createTextField("gallery_txt", _level0.getNextHighestDepth(), gallery_txt._x, gallery_txt._height+gallery_txt._y+(i*gallery_txt. _height), gallery_txt._width, gallery_txt._height);
_level0[string].gallery_txt.text = ["date_"+i]+""+["album_"+i];
_level0[string].gallery_txt.setTextFormat(my_fmt);
_level0[string].gallery_txt.selectable = false;
_level0[string].link = ["album_"+i];
_level0[string].onPress = function()
{
selectedAlbum = this.link;
var len2:Number = albums;
for(var j:Number = 0; j<len2; j++)
{
_level0["gallery_"+j].removeMovieClip();
}
end = false;
_level0.gotoAndStop(_currentframe+1);
}
}
gallery_txt.text = "";
clearInterval(param_interval);
}
}
var param_interval:Number = setInterval(checkParamsLoaded, 100);

----

stop();

download_btn._alpha = 0;
close_btn._alpha = 0;

createEmptyMovieClip("thumbVars", _level0.getNextHighestDepth());
loadVariables(siteURL+"albums.php?thumbs=true&albu m="+selectedAlbum, thumbVars);

var param_interval:Number = setInterval(checkParamsLoaded, 100);
var thumbNum:Number = 0;
var thumbsKeeper:Object = new Object();
var bigPicturePath:Object = new Object();
var picture:MovieClip = _level0.createEmptyMovieClip("picture", _level0.getNextHighestDepth());
var bigPictureLoaded:Boolean = false;
var picLoader:MovieClipLoader = new MovieClipLoader();
var currentPicture:MovieClip;
var currentPicturePlacement:Object = new Object();

var pictureListener:Object = new Object();
pictureListener.onLoadInit = function(mc:MovieClip):Void
{
mc.swapDepths(_level0.getNextHighestDepth()-1);
mc._x = _width/2 - mc._width/2;
mc._y = _height/2 - mc._height/2;
mc.onPress = function()
{
closeBigPicture();
}
}
pictureListener.onLoadProgress = function(mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void
{
var percent:Number = bytesLoaded/bytesTotal;
var xMove:Number = (_width/2 - mc._width/2) - currentPicture._x;
var yMove:Number = (_height/2 - mc._height/2) - currentPicture._y;
_level0.currentPicture._x += xMove*percent;
_level0.currentPicture._y += yMove*percent;
download_btn._alpha = 100*percent;
close_btn._alpha = 100*percent;
}
picLoader.addListener(pictureListener);


function checkParamsLoaded()
{
if(!thumbVars.end)
{
}else
{
var len:Number = thumbVars.thumbs;
for(var i:Number = 0; i<len; i++)
{
var path:String = siteURL+"Uploader/galleries/"+selectedAlbum+'/thumbs/'+thumbVars['thumb_'+i];
loadThumbClip(path);
var bigPath:String = siteURL+"Uploader/galleries/"+selectedAlbum+'/'+thumbVars['thumb_'+i];
bigPicturePath["_level0.thumb_"+i] = bigPath;
}
clearInterval(param_interval);
}
}

function loadThumbClip(path:String):Void
{
var container:MovieClip = createEmptyMovieClip("thumb_"+thumbNum, this.getNextHighestDepth());
thumbsKeeper["_level0.thumb_"+thumbNum] = thumbNum;

Loading A SWF Over The Top Of An Existing SWF?
HI,

Wondering how to replace a swf on the stage with another swf and unloading the one before it?

example:

a swf that contains level 1 of a game is on stage then when the player completes level 1 it unloads level 1 swf and loads in level 2 swf.

thus ensuring swf level 1 is completely off the stage and out of memory.

many thanks

oh in AS3

Loading Swf In Existing MC
I know its a very noobish question but im kinda stumped. Im trying to make a gallery and I have my thumbnails calling different swfs but I want them to call the swfs in one mc so they can replace each other when every I click on them I have seccess in the 1st swf but everytime I trying doing another anothing the swf it doesnt replace the existing one.

Heres the code that works for the 1st swf as you can see I created a empty MC so I can position each swf that I call.

ActionScript Code:
lion1.onRelease = function() {
var myClip:MovieClip=this.createEmptyMovieClip("pics",0);
this.pics.loadMovie("Pics/pic1.swf");
this.pics._x=164;
this.pics._y=0;
}

This is the same code as you see but with a different button and pic loading im no flash expert but I think my problem is that its createing another MC but I dont understand how it could do that if there is already an exsiting MC already named pics.

ActionScript Code:
lion2.onRelease = function() {
var myClip:MovieClip=this.createEmptyMovieClip("pics",0);
this.pics.loadMovie("Pics/pic2.swf");
this.pics._x=164;
this.pics._y=0;
}

Any help is much appreciated.

Loading An MC Into The Place Of An Existing MC
Hi,

I am trying to make a button load a MC into the place of an existing MC, i.e. I have an MC on my timeline called music, with the instance name "musictarget" and on the click of a button I want to load another MC, nomusic from the library into it's place. All this is within another MC, not the main timeline. I also want to be able to load the original "music" MC back in again with the click of another button.

I'm assuming that I have to use a target, but I just can't get my head around the whole thing. I'm really bad with ActionScript, I don't have a clue what I'm doing, so as much help as possible would be greatly appreciated.

Thanks a lot...

Loading A Swf File Into An Existing Swf
Help!!! I'm having problems with loading a swf file into my main page. I'm using a buttom to call out this swf file and I created a empty cointeiner, but when it gets call out the external file takes over covering the whole thing. I like to know how I can fix this. I tried using different levels and when I use 0 it just opens like if I had a new window, if I use level 1 the swf file blinks in the screen and I get a blank screew. So makeing a long story short. I have used several methods and still not getting any resolts....
Thank you for any help

Loading An External .swf Into A Pre-existing .swf
Hello,

What I wan't to do is load a .swf into an existing .swf to keep down loadtimes. I've placed the visual representation of the actuall loading on the external .swf so all I need is how to do "on click, load this here". Example: http://www.hundsteg.se/kurser.html (Actuall website I need this for, I'm redesigning it)

I would copy the elements/AS from the website above but it doesn't work. So obviously I've missed something. What I've got is quite simply:

Code:
loadMovie("my_path/my_swf.swf", "stageloader");
"stageloader" being the instance name of a movieclip on the _root containing a graphic at the size I want loaded loaded .swf's to fit.

I remember following a tutorial when I did this the first time but I can't find one that I can understand or follow to a working example. A link to a simple tutorial would be greatly appriciated if not another solution.

Thanks!

Loading An External Swf Into An Existing One To Show Another Mc On Top Of This One?
Hi,

I hava a mc loaded into the _root and then I use attachMovie("the usual stuff goes here") to put a couple of white squares above this mc. The squares are placed in the level above the mc and then I continue to increase the level to place the square upon, until there's no more squares to place. Everything works fine.

Then I modify my code a bit and use mc.loadMovie to replace my first clip, but then the white squares doesn't show. Just the recently loaded mc. Does anyone know why this happens?

If I instead of attaching the squares mc to the level just above the original mc (the one I want to be hidden by the squares), attach the squares mc to a level with is at least equal to the number of squares to be placed, then the problem is solved.

But I don't understand why. Can anyone please tell me why?

Example code:

// ============================================
// Load external swf.
// This is the one to be masked.
// ============================================

_root.bgpic.loadMovie("testbild.swf");


// ============================================
// Attach the movieclip with the square
// ============================================

attachMovie("square","square11",17);

Loading An External Swf With Existing Pre-loader
i am using flash 5 and recentlyused this tutorial

http://www.flashkit.com/tutorials/Ac...89/more2.shtml

to produce a pre-loader for my movie, further i have added some sound by importing an external swf with just background music within it.
when my movie loads it doesn't load the external swf which causes the sound to play at the wrong point can some one please inform me on either how to

modify the existing preloader to include this external file
-or-
to make another scene to preload the external file after the main preloader (preferred option)
-or-
and if it comes to it a seperate preloader altogether that loads external files aswell

i am not worried about losing the kb and % loading updates

AttachMovie - Playing Out Existing MC Then Loading New MC
Hi I need a little help with this please:

On the root of my movie I have a empty container MC called 'container'.

I have a number of MC's that will load into this container via individual
buttons....lets say 'but1' loads 'MC1' into 'container', 'but2' loads 'MC2',
'but3' loads 'MC3' etc.

Each of these MC's is animated in two halves...an 'intro' which plays when
the MC loads and then it stops midway.
The last half is an 'outro' for smooth transition when it unloads before the
next MC loads.

What I need to know is how to:

a) write the correct syntax actionscript on each button that basically says:
on release, play the 'outro' of the current MC and once this has happened,
attach the relevant MC and play.

b) as the buttons (which load the MC's) can be pressed in any order, I can't
state the actual name of the existing MC to play the 'outro' of, so it needs
to play the current/existing MC's label 'outro'...whichever is there.

c) it needs to know when it has reached the end of the currrent MC's 'outro'
before it loads the new MC


Hope I have written that clearly enough for someone to understand

Thanks in advance

Chris W

Loading Music Player Over Existing Levels
Ok, I have an intro which is on level 0.
The intro has eight buttons which load various MC's which are all on level 0, primarily because I want each to replace the intro when called. Now my problem is this...I have a music player.swf which I want to run through the entire duration, loading with the intro. I tried to load it with the intro on level 1, It loads fine, but when I load other MC's it does not appear. Do I have to re-load this clip with every MC (8 in all). Any input is appreciated. Thanks in advance-Chris

Loading Existing HTML Document Into Flash
Hi all

I am building a tool for editing xml that configures various sites we have.

The sites are located as follows:

http://www.sitename.com/siteversion/siteconfig.xml

there is an html page at http://www.sitename.com/ with a <base href=""> tag in that points the user's browser at the correct folder for the current version.

I want to load the html page, parse out the base href tag and get the location of the current site version then load the xml file.

Is this possible? loadVars won't do it and an xml object won't load the html in either.

Thanks.

Loading An External Clip(swf) And Removing Existing One
Hi All,

I am tearing my hair out; I simply want a button when clicked, to load an external swf. But I just can't seem to get my head around it. Here is my code:

butt1_btn.addEventListener(MouseEvent.CLICK, swf1);



function swf1(evt:MouseEvent):void
{
loadSwf1.load(new URLRequest("swf1.swf") );
}


butt1_btn.buttonMode = true;


Any help with this would be much appreciated!

Kind Regards,

Boxing Boom

[F8] Keeping Existing (_root.) Script Whilst Loading Into Another .swf
HEY,

Ive got a problem, I am loading a .swf through a MCholder in another swf but the movies inside the original having _root. as the script dont work properly as the _root. script refers to the new timeline (im guessing).

I've tried _parent. but that doens't work.

ANYHELP its been Driving me Crazy!!!

Cheers

Loading An New Swf And Uloading The Previous
Hey everybody. I'm new at actionscript 3.0, and I'm sorry if this question has already been answered, but I've checked some similar threads, and haven't found anything that could help me.

I saw a lot of people asking how they could load external swf files into the main swf file and then unload them, but this isn't what I'm looking for.

I have a main swf, which is a menu, and in that menu I have a button that, if clicked, brings another swf file on top of the menu. But what I want is for the menu to disappear completely and leave me alone with the swf file I just opened. I created a loader and then added a child, etc.. Then when I activate the loader, it loads the external swf... but I know that the menu is still there, because if I erase the background on the external swf, i can still see it underneath. So, in short, what I'm asking is.. is there a way to open an external swf and close the original at the same time?

Many thanks in advance to anyone willing to give a hand ;-)

UnLoad Previous .swf Before Loading New .swf
I'm using the "Full Flash Site" Tutorial, and and trying to get the SWF files to fade in and out when they load, so that it isn't so jumpy. I have gotten them to fade in properly, however, when I click the bottons to load the next .swf the old one disappears immediatly, and the new one fades in, causing an equally unattractive problem.

This Script appears on the black mc:


ActionScript Code:
onClipEvent(load) {    {    dir = 0;    speed = 6;    _alpha = 0;    }        this.dir = 1;}onClipEvent(unload) {        this.dir = -1;}onClipEvent(enterFrame){        var temp1 = this._alpha + speed*dir;        this._alpha = Math.min(100,Math.max(temp1,00));}


Thanks in advance.

Loading External Swf Over Each Previous One...
hi i have like 7 pages, and i have each one, i want the new one, (whichever button you choose (swf loading)) to load over the existing swf... beacus i dont want there to be a pause in the pages, i want the new one to load up, and sotp on the first frame, over the current swf, then start the loading, and unload the swf that was previous.

so like if each swf is named "page" i want it to be like on press for button load "page" then when the new one starts, on clip event unload movie num (page) but i want each "page" to load over the current one... heheh understand? thanks...

UnLoad Previous .swf Before Loading New .swf
I'm using the "Full Flash Site" Tutorial, and and trying to get the SWF files to fade in and out when they load, so that it isn't so jumpy. I have gotten them to fade in properly, however, when I click the bottons to load the next .swf the old one disappears immediatly, and the new one fades in, causing an equally unattractive problem.

This Script appears on the black mc:


ActionScript Code:
onClipEvent(load) {    {    dir = 0;    speed = 6;    _alpha = 0;    }        this.dir = 1;}onClipEvent(unload) {        this.dir = -1;}onClipEvent(enterFrame){        var temp1 = this._alpha + speed*dir;        this._alpha = Math.min(100,Math.max(temp1,00));}


Thanks in advance.

Disabling Previous Page When Loading A New
When i load a new swf file on top of a previous file, the buttons on the previous page are still active and you can click on them. you can't see them, but the little hand appears as if there is a button there. how do i disable the previous pages buttons when i load in a new one?

Loading Next And Previous SWFs Into A SWF Container
Hi

I have up until now been using scenes or very large single swf file for movies, however I have been looking at using the unload swf function but to say I am a little confused is an under statment... Prehaps if I state my needs someone could give me some help or point me to a helpful tutorial or example that has already been done!!...

I have a top level SWF that has a graphical 'TV' Screen and two buttons, Next and Previous. I have 9 other swf files that need loading in 3 ways:

1. Automatic .. First plays then when end of swf1 is reached then swf2 plays.. so on and so on..

2. Press the Next button which loads in the 'next' swf

3. Previous Button that loads the 'previous' swf..

I have found a couple of examples that do bits of this but Im sure there must be something out there that hits everything and probably stuff I havent thought of...

Any help much apprieciated..

Steve

[F8] Problem With Loading MC Into A Previous Loaded MC
hello guys!
I was like wondering maybe you can help me out here because i have this problem with actionscript and i've tried over and over again to solve it but still... .
So...

I have a swf (A.swf) and into it ....i load the "B.swf" ....that works fine ....but when i try to load something into the "B.swf" Ie pic1.jpg i can see the loaded content only in "B.swf". In A.swf it doesn't appear...doe the "B.swf" is still there.

Is like a nested loading system. and it doesn't work
Any help?

Loading Xml Data With Previous/next Buttons
hey everyone,

i'm trying to seperate some xml data into seperate pages. six entries on each page with three rows and two columns. i got the data to go into two columns...now i'm just trying to set up the next and previous buttons as well as showing only six entries per page.

i looked all over online but had no luck. any help would be greatly appreciated!

source and xml file attached.

Loading Swf In Container Over Other Swf Unloads Previous Swf?
okaay.. here is my doubt...

I have a main swf, which has the header of the website on top and buttons to navigate at the bottom. In the middle I have a container_mc where I load the swf's triggered by the bottom buttons.
Let's say, for simplicity sake, that I have 5 buttons - A, B, C, D and E, which load the A.swf, B.swf, C.swf, D.swf and E.swf files into the container.

My initial thought was that if I have A.swf loaded, and I click on B, that B.swf would load over A.swf, clearing A.swf from the website.
I am starting to think that is not so.
Note: I have no command to unload A.swf when I call B.swf. (because I assumed it was eliminated when a new swf was loaded)

The reason I think it isn't unloaded is because of 2 strange behaviors:

Strange behavior 1-
A.swf has a photo slideshow. I set the fade interval between the slides for 2.5 seconds. If I call B.swf, then call A.swf back again, the interval is smaller. If I repeat the above, the interval almost disappears.. I have the feeling it is loading one slideshow over the same slideshow...
This is the code:

Code:
//-----------OLD TV SLIDE PHOTO DISPLAY------------------------------

//: CALL IMPORT
import flash.display.BitmapData;

//: SETUP VARIABLES
var maxTVval = 4;// max number of fotos
var oldTVvar1 = 0;// keep track of previous random number
var oldTVvar2 = 0;// keep track of previous random number
var oldTVvar3 = 0;// keep track of previous random number
var newTVvar = 0;// used to load the next image
var si = 0;// interval variable

//: LOAD THE NEXT IMAGE
function getImage() {
newTVvar = Math.floor(Math.random() * maxTVval);// get random number
if (newTVvar == oldTVvar1 || newTVvar == oldTVvar2 || newTVvar == oldTVvar3) {// if number = old number..
getImage();// get a number
} else {// else
oldTVvar3 = oldTVvar2; // set old to new number
oldTVvar2 = oldTVvar1; // set old to new number
oldTVvar1 = newTVvar; // set old to new number
var linkageId:String = ("video" + newTVvar + ".jpg");// load the next image
var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId);// get image from library
TVpicscontainer_mc.attachBitmap(myBitmapData, this.getNextHighestDepth());// attach image to container

TVpicscontainer_mc._alpha = 0;// set its alpha to 0
TVpicscontainer_mc.onEnterFrame = fadeIn;// start fading out
delete this.onEnterFrame;// delete loop
}
}

//: FADE IN THE CURRENT MOVIECLIP
function fadeIn () {
if (this._alpha <= 100) {// if the movieclips alpha is greater than 0
this._alpha += 5;// reduce alpha by 5
} else {// else
this._alpha = 100;// reduce alpha to 0
delete this.onEnterFrame;// delete handler
si = setInterval(fadeOut, 2500);// after 2.5 seconds, fade out the movieclip
}
}

//: FADE OUT THE CURRENT MOVIECLIP
function fadeOut () {
clearInterval(si);// clear the interval variable
TVpicscontainer_mc.onEnterFrame = function() {// create loop to fade out
if (this._alpha >= 0) {// if the movieclips alpha is greater than 0
this._alpha -= 5;// reduce alpha by 5
} else {// else
this._alpha = 0;// reduce alpha to 0
delete this.onEnterFrame;// delete handler
getImage();// load the next image
}
}
}

// load first image
getImage();

//-----------END OF MAIN SLIDE video DISPLAY---------------------------\
Strange behavior 2 -
I have a toggle button, in the format of a flag, toggling the language chosen by the website visitor. The default is english (UK flag), but the visitor can choose portuguese (BR flag) in any of the swf files. The choice is stored in a global variable called _global.txtLanguage, and whenever visitor chooses a new swf by clicking on A, B, C, D or E the new swf has a onEnterFrame function to check what language is in the global variable and sends the flag_mc to the appropriate frame, displaying the alternative language flag on the toggle button. The problem is that when the swf file is called a second time only the defauld flag is displayed. A mouseover changes it correctly showing that _global.txtLanguage is correct. The feeling is that the onEnterFrame doesn't run except on the first time the swf is called. All subsequent calls do not trigger it.
This is the code:

Code:
//----------------Set Flag button-------------------------------

onEnterFrame = function () { // when movie is called, do this function
if (_global.txtLanguage != "port") {// check if language is different than portuguese
flag_mc.gotoAndStop("br_flag");// if yes, goto and stop on the brazilian flag of the flag_mc movie
delete this.onEnterFrame;// stop the onEnterFrame
} else {
flag_mc.gotoAndStop("uk_flag");// if no, goto and stop on the british flag of the flag_mc movie
delete this.onEnterFrame;// stop the onEnterFrame
}
}
So the questions that baffle me:
1) Why does the slideshow alter the fade interval upon reloads?
2) Why doesn't the toggle button run the onEnterFrame upon reloads?
3) Do I need to unload swf files before calling new swf files? What would be the proper code to do that ?

Any enlightment on my doubts are bound to receive my eternal gratitude
Best regards

Loading External Movies Via Next/previous Buttons
Hello all-

I'm about to program out a piece where I have a PDA with next and previous buttons on it where it will load 7 external movies to play in the screen area. I'm not sure about the correct approach on building this out in such a way so that the next/previous buttons call up the correct external movies.

I've looked up different approaches to using arrays as well as different nav button suggestions. Any help or guidance will be greatly appreciated.

Noob Question About Loading A Kirupa Image Scroller Into An Existing Flash Page ^^
I created a simple flash page for my photography section on my site. Here is a picture of it in my flash workspace:
I had no problems until I started trying to make photo.s load within the movieclip space I set (the white area next to the news space). I followed a couple of nice tutorials, but this one was the one that fit exactly what I wanted -Kirupa image scroller. The problem is that I think the movie scroller is meant as a standalone flash movie and when I tried to imbed it into the movie space in mine it just took precedence and hid the entire flash page I wanted as the base. Basically I think I need to learn how to imbed one flash movie into a parent flash movie to pull this off, or maybe there is a much smarter and more straightforward method I am missing because I am so new to this? Thanks ahead of time for any responses, and I am sorry if this is really simple. I am very new to flash development.

Loading And Unloading ASP
Hey, folks.

Here's the deal -

I've got a .swf that sits at the top of an html website. The .swf contains sound - and a nifty on/off toggle button to turn said annoying sound on or off.

Unfortunately, the .swf is not in its own frame - so every time a link is clicked, the .swf is reloaded.

I'm DESPERATELY trying to pass a 'sound' variable from the .swf (eg. sound == "on") into asp.

THIS seems to be working - because I can see the sound=on (for example) tag in the url when the page reloads, and when I view the source of the .asp document.

Now... how in tarnation do I get Flash to load the value from the ASP? It's clearly not doing that. It's in the query string - it's in the url - hell, when I view the source, the value in the ASP is changing.

How do I succesfully load the value 'sound' from the ASP into Flash?


stop ();
if (_level0.sound != "off") {
tellTarget ("sound_toggle") {
gotoAndStop (2);
}
} else {
tellTarget ("sound_toggle") {
gotoAndStop (3);
}
}

I know how to load values from, say, a text file - does it work the same way, especially given that the ASP is continually being changed by the Flash?


Does anyone have ANY idea how to save seven professional developers from insanity?

Thanks, folks!

- Thingee

Loading & Unloading....
Hi All,

i am loading a few external swf's into some container MC's on the stage...they are loaded from a nav bar...they all sit in exactly the same position...

when i click the services button a 680X330 movie loads to coordinates X=0Y=0

when i click the contactus button a 680X330 movie loads to coordinates X=0Y=0

and so on..

they pretty much lie on top of each other...


Q:________________________________________________ _
Do i need to unload these swf before i load another and...if so..how do i do that

Cheers

Loading And Unloading SWF
Hi...everybody
i have 1 problem, i am having a main movie in that movie i load a swf file on click of a button, and it loads that swf file, now when that loaded swf work is over i unload it but now when i return to my main movie i want it to go to a particular frame and not to the start of the frame.

Pls can ne body help me?

Loading And Unloading....
Is there any reason why this code, the script for a button on a swf loaded on Level 1, shouldn't take me back to a frame on Level 0? I can't figure out what I'm doing wrong!!

on (release) {
unloadMovieNum (1);
_level0.gotoAndPlay("storyone");
}

Please help...

Thanks

Loading And Unloading Swf's
Does anyone know how to unload and then load a swf into a cell in dreamweaver i'm a little stuck someone suggested using dreamweaver anchors to label the cell and then target that from flash, But my actionscript knowledge is a bit poor. Can anyone help??
Thanks

Loading And Unloading
hi,

I have created an auto running presentation.
The flow is as follows:-

The main file: "main.swf". I am calling "a.swf" from the last frame of "main.swf".

Now after the animation in the "a.swf" file is over, I am loading "b.swf" and unloading "a.swf". (using the same level - "2").

The image on the lst frame of "a.swf" is the image on the first frame of "b.swf".

But the problem is that there is a very prominent jerk on load of "b.swf" (it looks as if there is a blank frame in between, whereas there is no such frame).

Please can anybody tell me how to remove this jerk or how to avoid it?

Thanks
swapna

Loading And Unloading A.s.a.p
hello friends i was trying to find out it there a way to load and unload a external movie clip with the same button. im trying to figure out when someone click on my button on my site and it goes to another page that's part of my site it loads on top of the main page and you can still see part of the other page how can i fix that. thanx

Loading And Unloading
I have a long verticle movie clip (Main), made up of four smaller movie clips (sub-Main).

To move between the sections I have this code

curSection = 0;
mySections.onEnterFrame = function() {
this._y -= (this._y-_root.curSection)*1;
};

and my buttons say:

on(press) {_root.curSection = 0;
}
and
on(press) {_root.curSection = -400;
}
etc . . .

In each of the sub-Main movie clips I have an empty movie clip with an instance name. This allows me to load an external .swf file. I use:
this.loadMovie("external.swf");

What I want to do is have these movies load ONLY when they are visible on the stage. That means they must unload too. I am having a problem with it. Any suggestions?

-shotbot

Loading And Unloading Swf's
Hello,

I am new to flash, but have built my first website using flash.

It seems to load and unload swf files well in explorer, but in netscape and safari it seems to stall or not work. It's strange how it works flawlessly in the Flash application and it seems buggy in different browsers. The website: http://cvdesignweb.com/

I think the problem is in how I load and unload swf files. Here is an expample of my scripts. Is there and easier way to do this, other than listing every possible movie to unload? Should I unload swf's before I load anything?

Thanks!

loadMovieNum("portfolio.swf", 30);

unloadMovieNum(10);
unloadMovieNum(20);

unloadMovieNum(40);
unloadMovieNum(50);
unloadMovieNum(60);
unloadMovieNum(70);
unloadMovieNum(80);
unloadMovieNum(90);
unloadMovieNum(100);

Loading/Unloading
I have a large .swf that needs a preloader to load. Now when I go to other .swf files should I load them? OR tell it to go to a html file?

I want to be efficient so that the user doesn't have to load the huge main page over again. I'm just confused on whats the best way to go from one flash page to the next.

Unloading A Swf And Loading It Again
I'm trying to do something that has turned out to be tougher than I thought it would be.

Basically, I've got a parent clip that creates an empty movie clip and then, using MovieClipLoader, loads an external swf into the child clip. The child clip then uses a setInterval function to periodically check a database and see if it has been updated and thus needs to be reloaded. If reload = true, then the interval should be cleared, the movieclip should be removed and the app should go back to the beginning of the parent clip and create an empty movieclip again and reload the swf again.

Everything works up to a point - when the external swf is called, the interval isn't cleared and then when then when the new updated swf is loaded, it will just skip over several frames (going, for example, from frame 2 to frame 16) causing all sorts of havoc. When the swf is loaded for the first time, it always runs perfectly.

My main theory about why this is happening is that I'm not _really_ removing the movieclip, even though I think I am. Here's how I create the clip and load the swf:


PHP Code:



var applicationSWF:MovieClip = _root.createEmptyMovieClip("applicationSWF", 2);
applicationSWF._lockroot = true;
var myMCL = new ssMovieClipLoader();
myMCL.loadClip(vDirectoryPath + vSwfConfig + "?"  + (new Date()).getTime(),"applicationSWF");




and here's how I'm clearing the interval and removing the clip from the child clip:

PHP Code:



if (lastUpdate < vSWFUpdateDate) {
    clearInterval(swfTimeoutID);
    this._parent.mcExit.gotoAndStop(1);
    this._alpha = 0;
    this._parent.loadingBar._alpha = 100;
    this._parent.gotoAndPlay(1);
    //this.unLoadClip();  //took this out because I thought it wasn't actually removing the clip
    this.removeMovieClip();
}




So my theory is that the movieclip isn't actually being removed, but it could be caused by some other problem that I don't realize so any other theories would be welcome as well. Right now, I'm reduced to staring at the screen and asking the computer, "Why aren't you working?"

Loading And Unloading?
been a while since I have worked in flash...

Using Flash 8, here is what I am trying to do.

I have a movie that has a section ( movie section ) that will randomly load and play 1 of 7 movies as the timeline plays.

It will also have a menu on the side that will stop the movie and load and play which ever movie ( 1 - 7 ) that was selected. At the end of the movie I would like it to continue on playing what would normally play after the "movie section".

So if it was never touched,.. it would play the timeline over and over and randomly insert (movie 1 - 7) when needed. But if one was selected from the links.. it would shoot back to the start of the "movie section" and play it and then carry on.

Just looking for some guidance here on this, any help would be great. Thanks!

Loading/unloading Swf
Hi,
I,m building a site in flash that loads different parts from external swf. No problem in doing that, but what are you personal suggestions.

I heard somewhere that the unload action can be a bit unstable, so the solution i currently use is...
loading the new swf in level 2 for example. If i need to see other part, just load on level 2 gain the new swf. When finished with viewing this files and what to return to original state, load a empty swf to level 2.

How do you do it? any ideas... I may be doing a 'no, no' without realising...

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