Preloader for external swf
first try, changed somethings from previous post, tried to
make different changes, instead of using if else tried to set an
onload handler both before and after the loadmovie sentence (not at
the same time of course), copy paste of what goes on each frame
(actionscript 1):
frame 1:
setProperty("", _focusrect, false);
Stage.showMenu = false;
fscommand("showmenu", "false");
fscommand("allowscale", "true");
var mensaje = "0 %";
this.createEmptyMovieClip("pantalla", 0);
pantalla._x = 0;
pantalla._y = 0;
loadMovie("centrino2x.swf", "pantalla");
frame 2
mensaje =
(pantalla.getBytesLoaded()/pantalla.getBytesTotal())*100;
mensaje = Math.round(mensaje)+" %";
play();
frame 3
if (pantalla.getBytesLoaded()==pantalla.getBytesTotal()) {
nextFrame();
} else {
prevFrame();
frame 4:
pantalla.swapDepths(0);
pantalla.play();
stop();
the result: the if else goes right by to next frame, so it
jumps as if the movie was whole loaded, remaining in last frame as
a blank screen till the movie loads. the message appears as 100% in
the half a sec it gets on screen. according to trace, bytes loaded
and bytes total = 0
version 2, i nearly copied it from a tutorial linked from
another post, most of the preloader stuff is nearly exact from the
tutorial, uses movieloader class (actionscript 2)
frame 1:
setProperty("", _focusrect, false);
Stage.showMenu = false;
fscommand("showmenu", "false");
fscommand("allowscale", "true");
var mensaje = "0 %";
this.createEmptyMovieClip("pantalla", 0);
pantalla._x = 0;
pantalla._y = 0;
var cargador:MovieClipLoader = new MovieClipLoader();
var control:Object = new Objetc();
control.onLoadProgress = function(target, loaded, total) {
aviso.text = Math.round((loaded/total)*100)+" %";
control.onLoadInit = function () {
nextFrame();
cargador.addListener(control);
cargador.loadClip("centrino2x.swf", pantalla);
stop();
frame 2:
pantalla.swapDepths(0);
pantalla.play();
stop();
the result: it never changes frame (as if it never finishes
loading), message giving percentage loaded never appears, and
traces on event handlers for listener never come out
i have no idea what %$#"&#" is wrong, i have spend quite
a time on this, which at first seemed like the easiest part, any
pointers?
when first executed pantalla.getBytesLoaded is probably 0 as
is pantalla.getBytesTotal() causing your problem.
to remedy, check that pantalla.getBytesLoaded()>0 and that
pantalla.getBytesLoaded()==pantalla.getBytesTotal().
Similar Messages
-
Preloader for External file Template question
I used the CS5 Flash templates>sample files>preloader for external file, to create my preloader.
The problem is that when the preloader is done and my SWF is loaded, my SWF has already started playing.
It is an animation that builds for 200 frames then buttons appear. By the time the SWF appears it has already gotten to the button frame.
Depending on connection speed I have caught the animation building.
Is there some action script I should put in my preloader or the first frame of my SWF to pause play?
Here is the preloader action:
var contentLoader:Loader;
loadContent("stage002.swf");
function loadContent(url:String):void {
contentLoader = new Loader();
contentLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loading);
contentLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded);
contentLoader.load(new URLRequest(url));
function contentLoaded(evt:Event):void {
//Optionally change to a clip holder and set progressbar visibility.
addChild(contentLoader);
function loading(evt:ProgressEvent):void {
var loaded:Number = evt.bytesLoaded / evt.bytesTotal;
setBarProgress(loaded);
function setBarProgress(value:Number) {
progressbar.bar.scaleX = value;
Thanks in advance!put a stop() on the first frame of your external swf in an otherwise empty first frame. when preloading is complete apply a play() to your loader's content cast as a movieclip:
function contentLoaded(evt:Event):void {
//Optionally change to a clip holder and set progressbar visibility.
addChild(contentLoader);
MovieClip(contentLoader.content).play(); -
Flash MX Preloader for external JPGs
Hey all! Any help would be greatly appreciated. In all
honesty, I have searched and studied and worked to get this myself,
which I do alot with code, etc. BUT I am going to admit I'm a "make
it pretty on the outside" kind of guy, and coding makes my eyeballs
fall out and well, honestly, I just don't get it. My brain can not
wrap itself around this. Sigh! So I could use your help a little.
This is what I'm wanting to do. I have a website,
www.luxeillustrato.com, and if you go to the portfolio area, and
click on any of the sections (take fine art for example); it will
showcase my works by loading external jpg files each time you click
the forward arrow button.
You can see I have preloaders on the site, that work fine. My
main page has a movie target with the instance name of photoM. You
click "artist", and it loads a new swf file into the photoM target.
IF you click on "portfolio", "fine art", it loads the fine art swf
file into photoM, using a preloader. THEN, if you click on the
forward arrow button, a new jpg image of my work is loaded into the
fine art movie target with the instance name of just
photo. As you can see, you have to wait until the jpg image
loads (and you start to wonder if it's doing anything.)
The problem is, it is not preloading the external jpgs, it's
just preloading the fine art swf. My preload code is currently:
stop();
onEnterFrame = function () {
totalBytes = _parent.getBytesTotal();
loadedBytes = _parent.getBytesLoaded();
percent = Math.ceil((loadedBytes/totalBytes)*100);
gotoAndStop(percent);
info_txt.text = percent+" %";
if (percent>=100) {
_parent.gotoAndPlay("inter");
I already have the preload animation bar created (as you can
see on the site.) What do I need to do to alter the code above (or
replace it) in order to have the external jpgs be preloaded as
well? For example's sake, let's just say I have four jpgs, titled
"door.jpg", "orange.jpg", "boyfriend.jpg", and "untitled.jpg" (in
case these are needed for the code. They may not be.)
I hope this is easy to understand. If NOT, just tell me. I'll
simplify. And seriously, thanks!put a stop() on the first frame of your external swf in an otherwise empty first frame. when preloading is complete apply a play() to your loader's content cast as a movieclip:
function contentLoaded(evt:Event):void {
//Optionally change to a clip holder and set progressbar visibility.
addChild(contentLoader);
MovieClip(contentLoader.content).play(); -
Play - Pause button for external .swf?
I'm trying to create buttons so a viewer can pause and then play an externally loaded swf. My project can be accessed at the linke below. This is how I want the project to function
-Click a room on the building (choose Accounting for this discussion)
-Click one of the demo options (choose Ending a Period for this discussion)
- Now that the demo plays, I want the user to be able to play and pause the demo swf.
The demo .swfs were created in Captivate so I don't have access to their timeline. They are loaded into an empty Loader component using the MovieClipLoader Class. Can anyone post some possible solutions to this problem? Thanks!
http://distribution.activant.com/demos/prophet21-on-demand/What would that look like? Right now they're loading using the following code:
btnCashCollect_btn.onRelease = function () {
mcLoader.loadClip("CashCollections.swf",myLoader);
btnEndPeriod_btn.enabled = false;
btnCashCollect_btn.enabled = false;
btnFinancialMGMT_btn.enabled = false;
_root.btnHome_mc._visible = false;
So would I use something like:
btnPause.onRelease = function() {
myLoader.content.pause();
Actually I just tried that and it didn't work...I need the buttons to work for multiple external swfs that will be loaded into myLoader -
Preloader in external swf not working
I have several external SWFs that are loaded into my site and
each one has a preloader. When I run them by themselves the
preloader works fine, but when it is embeded into the main SWF the
preloaders do not work. Any ideas?
here is my actionscript -
lBytes = _root.getBytesLoaded();
tBytes = _root.getBytesTotal();
percentLoaded = Math.floor((lBytes/tBytes)*100);
loader.bar._xscale = percentLoaded;
loader.percent.text = percentLoaded + "% of " +
Math.floor(tBytes/1024) + "K loaded.";
if (lBytes>=tBytes && tBytes>0) {
if (count>=12) {
gotoAndPlay("enter");
} else {
count++;
gotoAndPlay("preload");
} else {
gotoAndPlay("preload");
}I am experiencing the exact same problem on my site -
www.expansiondesign.com
It works in flash player but not when live (tested safari and
firefox)
I don't know if you are using the same script as I am paul.
I execute the following when each image button is pressed:
button1.onRelease = function () {
startLoading("image1.jpg");
which runs this:
function startLoading(whichImage) {
loadMovie(whichImage, "_root.image_holder");
_root.onEnterFrame = function() {
infoLoaded = _root.image_holder.getBytesLoaded();
infoTotal = _root.image_holder.getBytesTotal();
percentage = (infoLoaded/infoTotal*100);
_root.loader._yscale = percentage;
_root.loader._visible = true;
if (percentage>=100) {
delete this.onEnterFrame;
_root.loader._visible = false;
Thanks,
Barton -
Preloader ignores external swf's actionscript
Hey guys
I have an External.swf file that is a video. The swf is 1135 frames long and running just fine by itself, stopping as I want when the actionscript says stop(); on the first frame and looping the end of the clip with gotoAndPlay(837).
The preloader SwfLoader.swf linked to the External.swf shows the percentage of bytes loaded as it should. However, it runs the video (sound playing in the background) while the preloader shows the loading progress I think it's because it doesn't load the first frame first.
Once the external swf is loaded, it plays the video again, still ignoring the first actionscript frame that says stop(); and the last frame gotoAndPlay(837).
Thank you.
Here is the preloader's actionscript on the first and only frame:
import flash.geom.*
import flash.display.*
var loadurl:String = "External.swf";
var nDepth:Number = 0;
var nWidth:Number = 200;
var nHeight:Number = 20;
var nPadding:Number = 3;
var cLoader:MovieClipLoader = new MovieClipLoader();
var oListener:Object = {onLoadInit:onContentLoaded};
var mcLoader:MovieClip = this.createEmptyMovieClip("Loader_MC", 0);
var mcContent:MovieClip = this.createEmptyMovieClip("Content_MC", 1);
var mcLoadBarBg:MovieClip = mcLoader.createEmptyMovieClip("LoadBarBg_MC", nDepth++);
var mcLoadBar:MovieClip = null; //Duplicated later with mcLoadBarBg
var txtPercLoad:TextField = null; //Create after duplication
var cMatrix:Matrix = new Matrix();
mcLoader._alpha = 0;
cMatrix.createGradientBox(nWidth, nHeight, 0, nPadding, nPadding);
cLoader.addListener(oListener);
mcLoader.lineStyle(1, 0x000066, 100);
DrawRect(mcLoader, 0, 0, nWidth, nHeight);
mcLoadBarBg.lineStyle(1, 0x0000FF, 0);
mcLoadBarBg.beginGradientFill("linear", [0x006699, 0x0066FF], [100,100], [0, 255], cMatrix, SpreadMethod.PAD);
DrawRect(mcLoadBarBg, 0, 0, nWidth - nPadding*2, nHeight - nPadding*2);
mcLoadBarBg.endFill();
mcLoadBar = mcLoadBarBg.duplicateMovieClip("LoadBar_MC", nDepth++);
txtPercLoad = mcLoader.createTextField("PercLoad_TXT", nDepth++, 0, 0, nWidth, nHeight);
mcLoadBar._alpha = 80;
mcLoadBarBg._alpha = 30;
Translate(mcTextMask, nPadding, nPadding);
Translate(mcLoadBarBg, nPadding, nPadding);
Translate(mcLoadBar, nPadding, nPadding);
mcLoadBar._xscale = 0;
mcContent._alpha = 0;
mcContent._lockroot = true;
mcLoader._x = Stage.width/2 - mcLoader._width/2;
mcLoader._y = Stage.height/2 - mcLoader._height/2;
txtPercLoad._x = mcLoader._width/2 - txtPercLoad._width/2;
txtPercLoad._y = mcLoader._height/2 - txtPercLoad._height/2;
SetTextFormat(txtPercLoad, "0%");
mcLoader._alpha = 100;
cLoader.loadClip(loadurl, mcContent);
_root.onEnterFrame = function()
var nBytesLoaded:Number = mcContent.getBytesLoaded();
var nBytesTotal:Number = mcContent.getBytesTotal();
var nPercLoaded:Number = Math.round(nBytesLoaded / nBytesTotal * 100);
if(nPercLoaded > 0)
SetTextFormat(txtPercLoad, nPercLoaded.toString() + "%");
mcLoadBar._xscale = nPercLoaded;
function onContentLoaded(Void):Void
//trace(_root + "::onContentLoaded");
SetTextFormat(txtPercLoad, "100%");
cLoader.removeListener(oListener);
delete _root.onEnterFrame;
delete oListener;
delete cLoader;
_root.onEnterFrame = function()
//trace(_root + "::onContentLoaded::_root.onEnterFrame");
var nInc:Number = 5;
mcLoader._alpha -= nInc;
mcContent._alpha += nInc;
if(mcLoader._alpha <= 0) startLoadedContent();
function startLoadedContent(Void):Void
delete _root.onEnterFrame;
mcLoader.removeMovieClip();
mcContent._alpha = 100;
mcContent.play();
function DrawRect(mc:MovieClip, nX:Number, nY:Number, nW:Number, nH:Number, nR:Number)
trace("DrawRect in: " + mc);
if(nR == undefined) nR = 6;
mc.moveTo(nX+nR,nY);
mc.lineTo(nX+nW-nR,nY);
mc.curveTo(nX+nW,nY,nX+nW,nY+nR);
mc.lineTo(nX+nW,nY+nH-nR);
mc.curveTo(nX+nW,nY+nH,nX+nW-nR,nY+nH);
mc.lineTo(nX+nR,nY+nH);
mc.curveTo(nX,nY+nH,nX,nY+nH-nR);
mc.lineTo(nX,nY+nR);
mc.curveTo(nX,nY,nX+nR,nY);
function SetTextFormat(txtField:TextField, sText:String)
var txtFmt:TextFormat = new TextFormat();
sText = "Loading... " + sText;
txtFmt.font = "Verdana";
txtFmt.align = "center";
txtFmt.size = 11;
txtFmt.color = 0x000066;
txtFmt.bold = true;
txtField.selectable = false;
txtField.text = sText;
txtField.setTextFormat(txtFmt);
txtFmt = null;
function Translate(mc:MovieClip, nX:Number, nY:Number):Void
mc._x = nX;
mc._y = nY;Hi kglad,
The external swf is a movieclip (flv embedded with an AS3 layer to control the timeline) exported as an swf file .
The first frame of the external swf is just stop();
I didn't know the proloader code was AS2 though
The preloader works fine with the external swf locally, but the problem happens when I run them from my server.
The external swf itself and its code works fine from the server, both combined don't, so I guess the problem comes from the preloader. Probably because of the AS being 2 insted of 3. -
Control script for external swf
I am loading an external swf to an empty container screen_mc
with the following from the main timeline
this.screen_mc.loadMovie("video.swf");
It loads and runs fine but I want to be able to stop and
start the swf with buttons but no matter how I target the clip I
cannot get either button to work - can anyone help?
Brian"bump"
-
Basic preloader for multiple swfs?
I've looked at 100+ discussions around the web, not one good answer.
I want some AS3 script equivalent to the following script (which I've made-up):
loadallthefollowingswfs.intocache("home.swf", "products.swf", "contact.swf");
I want a bunch of different swfs, all of which are in the same directory, to be loaded into the cache prior to viewing any of the swfs.
I would like to put this script into the first frame of an index.swf
Upon loading ALL of the swfs into the cache, it will move on to frame 2 of the index.swf and continue forward.
All of the other discussions around the web state to either "have each swf load once it is opened" (I don't want that, I want them all preloaded into the cache prior to viewing any one of the swfs), or the discussions say "you should combine all of the flas into a single fla and just preload that one swf file (I don't want that either, I want seperate fla/swf files).
Anyone have any suggestions on how to load multiple swfs into the cache when accessing one frame of an swf?
Thank you.Greetings,
Actually I just want to ask you guys about how will I be able to use these snippet? I tried to insert a trace inside the else area of the if statement, but, didn't showed up any results in the output window...
BTW: I just paste this snippet inside a new layer new flash file and saved it along with the two .swf files.
var swfA:Array=["home.swf","works.swf"];
var index:Number = 0;
var targetMC:MovieClip=this.createEmptyMovieClip("targetMC",this.getNextHighestDepth());
targetMC._alpha = 0;
var mcl:MovieClipLoader=new MovieClipLoader();
var lo:Object = {};
lo.onLoadInit = function(target:MovieClip)
index++;
if(index<swfA.length)
loadF();
else
// all are loaded. do whatever
trace("Load Ok...");
loadF();
function loadF()
mcl.loadClip(swfA[index],targetMC);
here's my code
var swfA:Array=["home.swf","works.swf"];
var index:Number = 0;
var targetMC:MovieClip=this.createEmptyMovieClip("targetMC",this.getNextHighestDepth());
targetMC._alpha = 0;
var mcl:MovieClipLoader=new MovieClipLoader();
var lo:Object = {};
lo.onLoadInit = function(target:MovieClip)
index++;
if(index<swfA.length)
loadF();
else
// all are loaded. do whatever
trace("Load Ok...");
loadF();
function loadF()
mcl.loadClip(swfA[index],targetMC); -
Script for external swf transitions
I borrowed some code to create menu transition swfs in which
as a button is pushed, it will look to see if the current swf is at
midframe and if so, play the exiting animation of that swf and then
load and play the intor for the swf for that button selection (hope
that makes sense).
However, I have enhanced my swf files to have a number of
stop actions for submenu items for that catagory so the swf does
not automatically just play to the midframe and stop. Is there a
way that I can modify the code so that if the swf is not at
midframe yet, I can have it "gotoandplay" midframe if that makes
sense?
Here's the code:
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "OrangeAll";
container.loadMovie("OrangeAll.swf");
} else if (_root.currMovie != "OrangeAll") {
if (container._currentframe >= container.midframe) {
_root.currMovie = "OrangeAll";
container.play();
Thanks,
Dave"bump"
-
OnSoundComplete for external swfs
My question is, does onSoundComplete works for sounds from
externally loaded swfs (these are loaded into 2 different
movieclips mc1 and mc2). I want swf1 to unload and swf2 to load
after the sound in swf1 has completed.
I used....
mc1.song1.onSoundComplete = function(){
unloadMovie(mc1);
mc2.loadMovie("song2.swf");
And nothing happens when song1 has completed, and I know
there is no problem with the external sounds because they play just
fine when they need to."Mike Eazy" <[email protected]> wrote in
message news:e9e0hb$eqk$[email protected]..
> Thats the problem, im sure the path is right because im
using the same path i
> used to pause, stop, play the sound, and i tried adding
if mc1.getBytesLoaded
> == mc1.getBytesTotal to it and it still doesnt work, any
other ideas?
Probably just missing the preloader part, as kglad mentioned.
I have a Ver 6 demo, example if you want to look at it.
http://www.kompanionkare.net/flash/audio/loader/loader.html
tralfaz -
Hi all I have a Director projector and when I click various
buttons this opens external files. Sometimes the external files
takes time to load. How can I create a preloader that the user can
view while the particular external file loads. Any help will be
appreciated.Hi,
Here's some info (and script) for loading assets from disk:
http://www.lingoworkshop.com/Articles/Preloading_cast_member.php
Basically, for local files, you cannot determine the progress
through a single large asset. The best you can do is monitor your
progress through a list of assets.
Another example that might be of help:
http://www.lingoworkshop.com/Articles/imageslider/Loading_Local_Images.php
-- Luke -
Need Preloader for Multiple SWF files
SORRY FOR THE DUPE POST, THE OTHER CAN BE DELETED. MY ADOBE
ID PROFILES WERE MESSED UP.
Hi forums, I'm new to Flash. I did the following:
1. Created a complex home page, about 3.5MB in size, due to a
large graphic I had to use many times over and couldn't make into a
symbol (long story). It's called INDEX.SWF, with accompanying
INDEX.HTML file from Flash
2. Split pieces of the INDEX.SWF file into multiple SWF files
to make it load faster
3. Created multiple layers in INDEX.SWF using loadMovieNum to
call to multiple SWF files from step 2
This works OK, but I think a preloader would optimize my page
animation. However:
1. I don't understand how a preloader file gets recognized on
the site load. If I create a file called PRELOADER.FLA and publish
it, how does the site know to use it first? Does it need a special
name?
2. Once I understand #1 above, I might be able to use some
sample preloader files I've found. It seems like all I have to do
is change the actionscript to point to my main file, but not sure
yet. I'll get to that next once I understand how the file even gets
recognized and loaded. Thanks for your help!PLEASE DELETE THIS POST AND USE NEWER ONE FROM
MOUSEHOUSESITE, I APOLOGIZE FOR DUPE POST DUE TO MESSED UP ADOBE
ID. -
How to set levels for external swf's??? loading code added!
hi,
im using flash cs5, as2.
i have a main index fla that loads into it 5 swf's.
i need these 5 to be loaded into a lower level than the main index fla (index has to be the highest level)
how can this be acheived?
i have no idea on how or where to code this.
my code for loading the movies is:
F1
var IndexLoaded = _root.getBytesLoaded();
var total = _root.getBytesTotal();
var percent = int(IndexLoaded/total*100);
var loadingName = "Loading.. " + percent + "%" + " of " + "Index";
var checkFrameplay = 0;
Bar_anime.gotoAndStop(percent);
Loadtext_txt.text = loadingName;
if (IndexLoaded == total) {
var n = 0;
gotoAndPlay(3);
F2
gotoAndPlay(1);
F3
var movie:MovieClip = _root.StoredActions.Con.createEmptyMovieClip("movie"+n,n +1);
loadMovie(n+".swf",_root.StoredActions.Con["movie"+n]);
var MovieLoaded = 0;
percent = 0;
_root.StoredActions.Con["movie"+n]._x = 3000;
F4
MovieLoaded = _root.StoredActions.Con["movie"+n].getBytesLoaded();
loadTotal = _root.StoredActions.Con["movie"+n].getBytesTotal();
percent = int(MovieLoaded/loadTotal*100);
Bar_anime.gotoAndStop(percent);
loadingName = ("Loading.. " + percent+ "%" + " of "+ n);
Loadtext_txt.text = loadingName;
if (loadTotal>10) {
if (MovieLoaded>=loadTotal) {
gotoAndPlay(6);
F5
gotoAndPlay(4);
F6
if (n < _root.nMenus) {
n++;
gotoAndPlay(3);
} else {
gotoAndStop("Stopload");
_root.gotoAndPlay("Playmovie");
F7
stop();
thanks in advance for any help.
sajjyhi,
i understand what you are saying about the code, im no advance user of as2 but i can say from all the research i have done, iv not seen anyone using this sort of code, its all over the place.
but on the other hand, even though its a mess, its working and all the site functions and buttons work well with the code.
basically the main.swf is the structure of the site, it has all the images/frames in the right places. the other swfs load into a little window on the main.swf. this window has some shading/reflections on it and the problem i have is when i scroll the movieclips, they scroll over the shading/reflections making it look tacky, if i didnt use any scrolling it would be fine but i need to use it due to having a small window.
the content of the window is controlled by a button thats on the main.swf.
each of the loaded swfs have dynamic text, movieclips, buttons to open external html windows. nothing advance to be honest, all the interactive movieclips are controlled by clicking on them, navigating to another frame (using labels).
i would upload the files for you to have a look but im under strict ruling that i cant share the content as its not yet been released to the public.
i hope that helps clear a few things up for you. if i cant get the levels to work then i guess it will have to stay like that or i will have to scrap the whole project and start again. -
I have a web site with a main movie that call to an external
movie.
My question is what is the action script to put a pre loader
in the main movie that will show the loading progress of the
external movie.
(now the preloader is in the external movie and its take time
until its showing the preloader and until then the page looks
empty)
Thanks in advance.Here is a sample I made that uses the progressBar component.
You could use
something similar.
http://www.smithmediafusion.com/blog/?p=31
Dan Mode
*Must Read*
http://www.smithmediafusion.com/blog
*Flash Helps*
http://www.smithmediafusion.com/blog/?cat=11
"mijal2" <[email protected]> wrote in
message
news:e2rfub$bbq$[email protected]..
>I have a web site with a main movie that call to an
external movie.
> My question is what is the action script to put a pre
loader in the main
> movie
> that will show the loading progress of the external
movie.
> (now the preloader is in the external movie and its take
time until its
> showing the preloader and until then the page looks
empty)
>
> Thanks in advance.
>
> -
Unload event for external swf[urgently need help]
hi all master,
iI've mp3, eksternally loaded and I controlled from main time...
the bugs are
1. If I wanna go to another .swf file, i still can hear the sound...
2. if I click the button wich linked to mp3.swf, the sound/song are duplicated by2, and then if I click again the sound are duplicated by3...
how I can fix this problem??? oia, the buttons to call another swf are only in main swf,
and here is the code:
//zhe button
var Xpos:Number = 140;
var Ypos:Number =100;
var swf:MovieClip;
var loader:Loader = new Loader();
addChild(loader);
// Btn function
function btnClick(event:MouseEvent):void {
if(loader)
loader.unload();
loader.unloadAndStop();
removeChild(loader);
loader=null;
loader=new Loader();
var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
// Btn listeners
shout.addEventListener(MouseEvent.CLICK, btnClick);
song.addEventListener(MouseEvent.CLICK, btnClick);
gallery.addEventListener(MouseEvent.CLICK, btnClick);
about.addEventListener(MouseEvent.CLICK, btnClick);
So, anybody can help me???then you can use:
//zhe button
var Xpos:Number = 140;
var Ypos:Number =100;
var swf:MovieClip;
var loader:Loader;
addChild(loader);
// Btn function
function btnClick(event:MouseEvent):void { if(loader!=null)
loader.unloadAndStop();
removeChild(loader);
loader=null;
loader=new Loader();
var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
// Btn listeners
shout.addEventListener(MouseEvent.CLICK, btnClick);
song.addEventListener(MouseEvent.CLICK, btnClick);
gallery.addEventListener(MouseEvent.CLICK, btnClick);
about.addEventListener(MouseEvent.CLICK, btnClick);
Maybe you are looking for
-
Entity created by method create_related_entity losing attribute referenz
Hi all, I created a new Z-relation between the IS-U connection object an an own object (inherited from CL_CRM_GENIL_ABSTR_SO_HANDLER2) to handle customer specific data. It works fine except for one point. Existing data are handled well, I can modify
-
TS3354 Video playback help - black screen
I'm trying to view my TV shows but all I get is a black screen. My movies seem to be loading just fine, though. I've already updated my iTunes thinking that that would be the problem, but nothing has changed. Any suggestions?
-
Order of Materialized View Refresh
Oracle 11g Just have a small question to ask and have not been able to find searching on the intertubs and the forum. I have a refresh group that refreshes four materialized views at 4 am every morning. That was working fine but now I need one of the
-
How to Display MAX, MIN and AVG in ALV
Hello Friends, Can some one help me with MAX, MIN and AVG in ALV.. I am displaying a screen with ALV.. it displays 3 columns.. below every column i have done .. summatation with the help of FIELDCATALOG-DO_SUM = 'X'. is there any way in which i can
-
I want to make a complaint but how? Cant find an address to write to?
I'm extremly annoyed: purchased a 13" mac book pro on 13/11/13 for my teenage sons birthday and christmas present, on 29/11/13 he couldnt start the mac book up. We took it to our nearest apple store & saw an apple genius, we left it with them for 2 h