Unload movie?
Hi,
I have 2 loader components - one named myPicLoader which
loads photos and another named myLoader which loads external swf's.
I want button 1 to load myPicLoader and button 2 to load
myLoader.
The unload movie command I think removes the loader from the
stage.
What code do I need to use so that on button 1, myPicLoader
loads, and button 2, myLoader loads?
Here is the code for my buttons. Thanks.
If you use the same depth to attach or load another Movie I
believe it will kill what is at that depth.
However you can explore
removeMovieClip.
Similar Messages
-
Hi Guys:
Have 2 unable solve issues, would be much appreciated if anyone could help.
// ISSUE 1 //
I am experiencing an issue with Load & Unload Movie. What happen is that I am trying to load an external SWF into a movie clip call movieContainer in my main website. This external SWF file has timeline that perform a animation when it's loaded into the movieContainer.
I can load and unload the movie with no problem...the issue is that after I unload the SWF and then at any point of the movie on the main website I click to load the SWF back to the stage.....the timeframe of the SWF file stay at where it get left off(when it's unloaded). I am trying to make it play start all over again.
I try the movieContainer.content.gotoAndPlay(1); but it doesn't do anything. Any idea how I could make this work?
Here is my code:
var content:Loader = new Loader();
content.load(new URLRequest("externalSwf/content.swf"));
loadMovieButton.addEventListener(MouseEvent.CLICK, loadMovieButtonClicked);
function loadMovieButtonClicked(e:MouseEvent):void{
movieContainer.addChild(content);
// ISSUE 2 //
In my external SWF file, I have create a loading loader at the 1st frame. But it doesn't play all the time when I testing on the server. It works just fine when I test locally with TEST MOVIE. Not only it doesn't play all the time.....it suppose to play from 2nd frame of the movie after the loading is finished (I have a short animation play between frame 2 - frame 20) Instead of playing from frame 2 to frame 20, the animation just jump straight to frame 20...which mean the user won't see the animation between frame 2 - frame 20.
import flash.events.ProgressEvent;
function update(e:ProgressEvent):void
var percent:Number = Math.floor( (e.bytesLoaded*100)/e.bytesTotal );
if(preloaderMC is MovieClip){
preloaderMC.gotoAndStop(percent);
//preload_txt.text = String(percent);
if(percent == 100){
gotoAndPlay(2);
loaderInfo.addEventListener(ProgressEvent.PROGRESS, update);
// Extra test for IE
var percent:Number = Math.floor( (this.loaderInfo.bytesLoaded*100)/this.loaderInfo.bytesTotal );
if(percent == 100){
nextFrame();
stop();
Many Thanks!Thanks for the reply, the code I use to load the external SWF is:
The button is within a movieClip: commercialScrollBar_mc
The button instance name is: stackPancakeBar
The external SWF get to load into a movieClip container call: projectDetailsContainer_mc
var ldr:Loader = new Loader();
ldr.load(new URLRequest("projectsCommercial/stackPancakeBar.swf"));
commercialScrollBar_mc.stackPancakeBar.addEventListener(MouseEvent.CLICK, stackPancakeBarClicked);
function stackPancakeBarClicked(e:MouseEvent):void{
MovieClip(ldr.content).gotoAndPlay(1);
projectDetailsContainer_mc.addChild(ldr);
I was thinking does it has anything to do with the UNLOAD script I have on the external SWF file? Below are the code for removing the child.
back_btn.addEventListener(MouseEvent.CLICK, removeProjectDetails);
function removeProjectDetails(e:MouseEvent):void{
this.parent.parent.removeChild(this.parent);
Thanks Heaps, by the way, do you have any idea why the loading sequence doesn't get to play every time? Or perhape the file size is too small? -
Loading and Unloading Movie Clip
I'm trying to create a timer that would affect when a movie
clip reloads after it has intitially unloaded using AS2. Could
anyone offer any possible options.
Thanks in advance.Look into the setInterval and setTimeout functions
-
Using Actionscript or Javascript to unload movie using Captivate 5.5
I have an application an agency built that houses my training videos (created with Captivate 5.5). Now users can click to start a video and then immediately close it and the application shows that they viewed/completed the entire movie. I need to find a way for Captivate to send a call (or something) to the application telling it that the movie has finished.
I do not know much Actionscript or Javascript but I am a fast learner. I read in past posts where this was accomplished in Captivate 2.0 and 3.0 by
1) coping the captivate movie into Flash and adding two lines of code (Actionscript)
import flash.external.Externalinterface;
External Interface.addCallback("unload", this, unloanSQF);
2) the following would be added to the HTML page
//Detect Flash container movie
function getFlashMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
else {
return document[movieName];
//Function to be called by Captivate
function captivateUnload() {
//Calls "unload" method established in ExternalInterface Actionscript code
getFlashMovie("simpleSwfLoader").unload();
3) Add the Javascript call captivateUnload() to the Captivate button.
I am hoping that the procedure has gotten better with 5.5; plus I do not want to use a button. I want the unload event to occur automatically when the movie ends. Plus, I can't see how to produce a fla version to be imported and edited in flash.
Any help or direction would greatly appreciated.
Thank you, JimIt sounds like you will need to change some functionality in the application that launces your Captivate SWF's. Currently they will be set to "completed" once they have been opened. The correct approach would be to have your application set them to "Incomplete" or "In Progress" and then have Captivate execute a JavaScript on the last slide calling a function in your application that sets the module as completed.
/Michael
www.cpguru.com - Adobe Captivate Widgets, Tutorials, Tips & Tricks and much more.. -
I made a flash file called "sss_menu.swf" which has 5 tabs (home, story, profile, gallery, and about me) that uses the loadmovie function to load their own .swf files, and nothing else. It's a base. So the menu, when clicked, home loads the movie "sss_home.swf", story loads "sss_story.swf" etc.
But I'm combining this menu to a group main menu called "menu.swf" that will load multiple individual menus. So the "menu.swf" after clicking a certain button will load "sss_menu.swf", and for example other individual menus such as "aaa_menu.swf" and "bbb_menu.swf".
If I want to move from the "sss_story.swf" to the "aaa_menu.swf" for example, my story.swf file doesn't unload. What should I do to unload it?apply unloadMovie() to its load-target movieclip
-
Cant unload movies on two different levels?
Hi guys,
I am having trouble with unload an loading movies. Basically I am loading a movie into a container, which works a charm:
graphicsbut.onRelease = function() {
_root.createEmptyMovieClip("container",1);
loadMovie("Graphics/Graphics.swf","container");
container._x = -22 ;
container._y = 0 ;
And then I want to load another movie above this one, also working:
Dyson_hit.onRelease = function()
Dyson_mc.gotoAndPlay("out");
loadMovieNum("Graphics/Catwalks.swf", 2);
disableBtns();
But NOW the problem....I want to unload them both when a close button is pressed on the third loaded swf?
Also, ideally I would like to add that second movie clip into a container, so I can position it correctly, but when I try copying the code I use on the first, it doesn't seem to work...is it to do with the "root" bit perhaps?to load both into a container movieclip:
graphicsbut.onRelease = function() {
_root.createEmptyMovieClip("container",1);
loadMovie("Graphics/Graphics.swf","container");
container._x = -22 ;
container._y = 0 ;
And then I want to load another movie above this one, also working:
Dyson_hit.onRelease = function()
Dyson_mc.gotoAndPlay("out");
_root.createEmptyMovieClip("container2",2); // use higher depth and different name
loadMovie("Graphics/Catwalks.swf", _root.container2);
disableBtns();
and you can control movieclips loaded into _levels: you must wait until loading is complete (ie, use preloader code or an mcl). -
I have my main movie clip and then I have a load movie that
then loads on top. This is fine however when the new swf loads on
top of this the sound plays and you get double the sound.
How do you prevent this? You can't really unload the main swf
becase you havent loaded it in the first place.There are different removers for different loading methods.
Look in the Flash help docs for the method you used to load the
clips. At the bottom of the page you should see some links to
related topics, one of which will likely be the one to be used to
remove clips that were added. -
Loading/unloading movie/image in actionscript
Hi I'm trying to load an image on the fly in flash which is
no problem, but then when i need it to unload it doesn't and i get
an
*** Security Sandbox Violation ***
Connection to
file:///C|/Documents%20and%20Settings/Administrator/Desktop/Latest%20Versions/High%20res% 20newsreader/
halted - not permitted from
http://MYSERVER/test/tfl.gif
-- Remote SWFs may not access local files.
Why does this happen? why would it load but not unload?
The load code is
_root.createEmptyMovieClip("box", 1);
_root.box.createEmptyMovieClip("pic_mc", 2);
_root.box.pic_mc._x = -40;
_root.box.pic_mc._y = 0;
_root.box.pic_mc.loadMovie( "
http://MYSERVER/test/tfl.gif"
and unload is
_root.box.pic_mc.unloadMovie();it has to do with settings in the player. For security
reasons, you can only load data from within your domain. Local
domain is always 127.0.0.1 or localhost. don't use
http:// inside your call to loadMovie. Always
use the local method (relative path from the current flash file
i.e. /test/tfl.gif) and make sure that the images are local. By
using that
http://MYSERVER, flash thinks that the
domain for the current running movie is MYSERVER and not localhost
therefore, it will restrict all access to local files. Now, if you
put the flash file up on MYSERVER, chances are like wwscoper just
pointed out, it will work perfectly because localhost and MYSERVER
refer to the same masked IP. -
Please Can someone point me to some god examplkes on loading and unloading swfs in AS3. I manage to load but unloading is a headache.
Thanks
Att.,
Edwinthere's nothing to study if you're using fp 10:
var yourloader:Loader=new Loader();
yourloader.load(new URLRequest("whatever.swf"));
function unloadF(){
yourloader.unloadAndStop(); -
Disable or unload movie clip features
Hello. I'm working on a project that has 2 movieclip
containers. They load external content, and they swap their depths
to show either content. When a movieclip that has buttons is behind
the other movieclip it still lets the user click on what is behind.
How can I unload the content of the movieclip that is behind or
disable all its buttons so this doesn't occur?one of several ways is to assign the lesser z-depth
movieclip's _visible property to be false. -
Loading and unloading movie loader
OK I have my mask working. I want to load a new file like
test.jpg with each event listener.
I need to add the url request to the event listener with the
goto and stop functions.Thanks it works great but I have one problem I don't
understand. The Home button loads the photo test.jpg fine in to the
mask, I made the About button load a photo called test2.jpg. but
the About button loads the photo but not in the mask. If I press
the Home button again the photo.jpg show behind the mask
correctly? -
Loading external movies differently
I am making a web site with several pages that the content
will load as an external movie. Right now I have all loading with
the nav buttons "on release". The first page loads through one
blank clip and the rest in another. What I would like to do is have
the first external page/clip content load with the main page and
also reload with the nav button if someone wishes to return and
leave the other buttons to remain loading each pages external
content like they are now. So is there a way to get the first pages
content to load both ways? This is what the code for the first
button looks like now :
on (release) {
//load Movie Behavior
if(this.aboutext == Number(this.aboutext)){
loadMovieNum("aboutus.swf",this.aboutext);
} else {
this.aboutext.loadMovie("aboutus.swf");
//End Behavior
//unload Movie Behavior
if(this.blk == Number(this.blk)){
unloadMovieNum(this.blk);
} else {
this.blk.unloadMovie();
//End Behavior
Right now everything works I just don't have any content
until a button is clicked.Hi,
Take a look at this simple tutorial and you will find what
you are looking for.
Here
Hope this helps
Cheers
Alan -
I've got 3 Flash movies (Flash v.4--yeh, I know) that
interact and I'm having trouble jumping back and forth from one to
the other. I'm using "load/unload" movie successfully with 2 but
can't work out the 3rd to function. All three are accessed from a
fourth Flash movie (via index.HTML), the opening "presenter" that
lists them as links. I've got 3 books on Flash, but can't find the
answer.
Also, is Flash version 4 a risk on today's internet being
behind by 4 newer versions? Thanks.if you're using loadMovie() to load 2 of your external swfs
why are you having trouble using loadMovie() for the 3rd? did you
create all 3 external swfs?
your swfs are no risk because the swf version doesn't affect
the flash player version. -
Hello... I am an ActionScript newbie. I followed a tutorial
from computer arts magazine, to create a portfolio using
actionscript and xml. I linked the portfolio to several scenes in
flash, such as contents and contact details. My problem is that
when I placed a button "back" on the main stage of the portfolio,
to redirect to the contents page, the list of artworks thats
populated from xml remains on the next scene, or any other scene i
link it to. I tried using unload movie clip, but nothing is
working. Please Help. This is my actionscript:
I don't if this helps, but I get this message in the output
panel: Target not found: Target="_root.btn_projectsundefined"
Base="_level0"check the flash help files. there's no better way to debug
your flash applications than the liberal use of the trace()
function.
for example: -
Closing a swf file with a button
I have a flash website that opens another flash website. I
want my quit button on this new site to close the swf file and
return back to the first flash site. I know that the quit fs
command completely closes a document only if it's a projector, but
I am only using swf files. So far the only way I know how to do
this is the unload movie script on my quit button for each level
that there is a movie. This script only unloads each movie in the
scene and turns the screen the same color as the background. I
don't know how to completely close the swf player for this movie.
Its probably very simple but I am stuck on this problem right now.
Any Suggestions???if you are navigating to another html page - then simply use
the getURL call and load the new page into the current browser
window - effectively 'closing' the previous swf.
however - another method would be to use a system wherein the
'main' html page contains a swf that is solely made for loading
'other' swf files using the MovieClipLoader class - in this way you
could simply load a new swf file into the same clip and depth as
the previous one - this will 'replace' anything that was currently
loaded at that depth.
Maybe you are looking for
-
How to Determine Color types in a file?
How can we tell if a document has any CMYK, RGB or Pantone colors within any object (curves, text, etc.)? The requires are just to report that the document has any CMYK and/or RGB and/or Pantone colors. We already can get the color for a bitmap ima
-
I have a 30gb iPod Video and when I plug it up to the cable nothing happens. Windows doesnt see it and neither does iTunes and the iPod itself doesnt light up when it's plugged in. But when I unplug the cable from the iPod(its still connected to the
-
Preview Shuts Down When Printing
Each time I try to print a file from Preview, the file does not print, Preview shuts down, and I receive the notification below. Does anyone have a clue of how to solve this? Process: Preview [172] Path: /Applications/Preview.app/C
-
Hi, I am new to Sun CC (WorkShop 6 update 2 C++ 5.3 2001/05/15). I get this error when compiling... Error: iterator_traits is not defined. Code line causing problem: typedef typename iterator_traits<Ptr>::value_type l_attr; Compiles fine with "gcc".
-
Error When Installing Repostitory
Hi, I encounter this error when running the installing repositotry. What does this error means ? What are the import views ? Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0