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








How Can I Stop An Image Being Loaded?


(I'm posting this message again... something weird happedn to the last post and no message was stored in the post.)

I've got a movie with several images.
I want to have a version without the images.
All my images are stored within my Flash file in movies.

I want to have a version where the images don't get compiled (and therefore making my resultant SWF file smaller).

Is there anyway I can do this in Actionscript?

The only other way is to manualy delete the images before compiling?

Any help would be appreciated.

Thanks.


OM




FlashKit > Flash Help > Flash ActionScript
Posted on: 11-06-2004, 08:08 PM


View Complete Forum Thread with Replies

Sponsored Links:

How Can I Stop An Image Being Loaded?
I've got a movie with several images.
I want to have a version without the images.
All my images are stored within my Flash file in movies.

I want to have a version where the images don't get compiled (and therefore making my resultant SWF file smaller).

Is there anyway I can do this in Actionscript?

The only other way is to manualy delete the images before compiling?

Any help would be appreciated.

Thanks.


OM

View Replies !    View Related
Loaded External Image Question: Use Default Image If Loaded Image Not Found?
Hello,

I use the following code to load an external logo into a Flash Movie.

Quote:




var myRequest:URLRequest=new URLRequest(logoPath);
var loader:Loader = new Loader();
loader.load(myRequest);
holder_mc.addChild(loader);




What if the logo file is not find? I wish that if the logo is not found, another default logo will be used, i.e.

if (logoPath is here) {
var myRequest:URLRequest=new URLRequest(logoPath);
} else (logoPath is not here) {
var myRequest:URLRequest=new URLRequest("defaultlogo.png");
}

How can I do that?

Thanks and best regards

Alex

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

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

Thank you all in advance.

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

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

Can anyone help me please?

Thanks,

allison

View Replies !    View Related
Mx2004 Cuts Loaded Image Borders - Image Format Problem?
hi mates

i know i didnt post here quite a long time (wasnt programming quite a long time too), and since i know this forum to be very helpful, i am back with one irritating problem.

i have some jpgs, all contents seem to be ok, and wanna load and rescale them (rescaling would work, thats not the problem). it seems my pictures have some format error, but i cant find it

they dont seem to get displayed completely. or better, their contents dont. that means, the content is displayed in a certain area, but not outside of it, although the image is fully loaded (at least getBytesTotal tells me so). i made a small file to test the picture loading, and it shows the same error as my real clip does.

- no, theres no mask applied
- no, the jpgs are no progressive types
- yes, i tried using baseline optimization, standard baseline, and different compressions.
- yes, when displaying the jpgs with any other tool than
- when inserting one of the pics to the stage in developing and then exporting it being inside the swf, it is displayed correctly
- btw, the pics are quite big (about 3000*2000px/300-700kB) for being able to zoom.

another issue i am noticing is that some areas inside the displayed area of the jpg are not displayed instantly when the jpg is displayed, and fadein (alpha) effects of other clips in front of these areas cause much more cpu load than they should.

anyone ever seen this problem? or anyone having an idea how to solve this one?

thx for reading, greets

self

View Replies !    View Related
Copying Loaded Image Bitmap Data To Another Image Loader
Hi,

I have an app where the user uploads an image into an image loader component. I am trying to figure out how to copy the bitmap data from that loaded image into another image loader component.

Could someone steer me in the right direction? I was looking at bitmap clone and copypixels though haven't figured out how to get this to work yet.

Thanks,

Dan

View Replies !    View Related
Tweening Image Container Mc Resizes Loaded Image.
Hello all.

I am having a problem with an image gallery I am writing. The basic logic is as follows:

*click* button -> Resize image container mc(img_mc) to the dimensions of the new image. This is done by passing the new dimensions as arguments to a function that uses the mx.tween property to tween the container_mc to the new dimensions.

Once the tween is complete, place the image in the container_mc .

the mc's are as follows:
img_mc.container_mc

img_mc: has a graphic with a pseudo drop shadow and on the timeline of img_mc is container_mc used as a landing place for the image.

View the example online. NOTE* you must resize the browser window in order for the site to appear properly.. I haven't setup the default yet)

Any help would be greatly appreciated.

View Replies !    View Related
Image Scroller- Loaded Image Keeps On Scrolling
Hello. I am working on a client image scroller for my compaines website. What I want to do is once the user click on a specific client logo, a image pops up inside a " holder" MC. But when this happens, the image that appears scrolls along with the scroller nav bar.

My question: is there a way to make the image linked to button to stop scrolling?

Please see the attachment and click on the " DELL" button to see what I am talking about.

TIA

View Replies !    View Related
Xml Loaded Image On Rollover Loads Another Image
I have a xml flash gallery, that has thumbnails when clicked loads the image, now when a user rolls onto that loaded image I want it to load another image/swf from specified in the xml file. Anyone know how I can do this?

View Replies !    View Related
When Image Loaded Load Next Movieclip's Image?
i have a series of duplicated MCs, each with an image, i want them to load 1 image at a time, and when that is 100% loaded tell the next movieclip to load its images and so on.
And when the final MC has completed loading call an action.

after the 1st mc's image has loaded though, all the others seem to start?!

mc action,

ActionScript Code:
onClipEvent (enterFrame) {
    loaded = this.getBytesLoaded()/this.getBytesTotal()*100;
    loadedb = this.getBytesLoaded()/this.getBytesTotal()*100;
    _parent.percent = Math.floor(loaded) add "%";
    //
    //
    if (loadedb<99 and loadedb>80 or loadedb === 100 and _parent.xxx eq "go") {
        _parent._parent["icon" add _parent.k].load_image();
        _parent.xxx = "done";
        _root.lastv.scrollerz.scrollbar_mcy.reset();
    }
    if (_parent.i == fff and _parent.xxx eq "done") {
        _parent.xxx = "complete";
        _root.lastv.scrollerz.scrollbar_mcy.reset();
        if (loaded == 100) {
            trace(this+"· !¡! ·"+loaded);
            _root.lastv.scrollerz.scrollbar_mcy.reset();
        }
    }
}


load image action,

PHP Code:



function load_image() {
    this._visible = 1;
    ladeBild(image_main, image_path add file_name);
    per._visible = 1;
    xxx = "go";


View Replies !    View Related
How Do I Get A Loaded Image To Change Size Into The Next Image
ok, that probably sounded a bit wierd here's a link http://www.ronyshram.com/ what I want to do is something I see a lot but don't understand, you click a thumbnail and an image opens, you click another thumbnail and the image fades but the shape/frame resizes or changes from landscape to portrait to fit the next image when it appears.
any tips or AS ideas would be of great help please.

View Replies !    View Related
Trying To Stop() Loaded Swf
I am loading an external swf that is just an animation. When I open a section in my app, I want that swf to stop playing. I cant manage to figure out how to stop it. Here is my function to load the swf

PHP Code:



var target:String = "data/clouds.swf";
var req:URLRequest = new URLRequest(target);
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, cloudsHandler);
ldr.load(req);
cloudHolder.addChild(ldr);
//then trying to stop it
function buildVideo():void
{
    var c = cloudHolder.getChildAt(0);
    c.content.stop(); //this does not work
}




any idea?

View Replies !    View Related
How Do I Stop A Loaded Movie
Thanks for checking in.

I've built a few small .swf movies, and now I've decided to load them at different times into an encompassing .swf movie.

The thing is, I want to be able to have a stop button in the main movie that will freeze the currently playing small .swf movie.


Can anyone jot down the action script for my stop button to be able to do this.

My main movie and the stop and start button are on layer 0, and my loadable .swfs are on layer 1.

Thanks a bunch, I've been cursing for hours now - instant karma is coming your way

DB

View Replies !    View Related
Stop Already Loaded Sounds?
Hi there, I have a tricky question in regard to using the sound object for loading mp3's dynamically. What I have is a movie which uses lots of different mp3's. The mp3's are loaded via mouse events in runtime using loadSound(). I have read that mp3's are cached when there loaded, so I dont want flash to keep reloading the sounds if they have been already loaded previously from an earlier mouse event. Have I lost you yet?

Anyway I was thinking that I could create a sound object for the first the time a particular sound is loaded and store that sound object in an array for later use, ie when that sound needs to be used again call that object.

Does that sound right? Does anyone have any examples or better ways of doing this....anything appreciated

View Replies !    View Related
How Do I Stop A Loaded Movie?
I have loaded my movie onto the main timeline and now want it to remain stopped until I make it visible later in the timeline, can someone please explain (like I'm a five year old!) how I would do this....

View Replies !    View Related
Loadmovie Not Loaded When I Stop()
hi,
i got 2 frames movie.
frame 1 loads a .jpg from .txt file (loads it fine).
and frame 2 loads the jpg into an MC.

the problem is that its not loading...

i tried to do a new movie, with just one frame and the loadMovie() command and it worked fine.
but with my 2 frames movie it's not working... what im doing wrong?

Avi.
(i added the movie for u to look)

View Replies !    View Related
Stop; Loaded Into Container.
How do i stop a swf that has been loaded into a container.

View Replies !    View Related
Stop External Loaded Swf
Hi
Im trying to load many swfs in one swf.
With Cursor Left Right you can jump to the next swf or go one back.
I also want that if i press Space the movie should stop.
But it seems that nothing works
Even if I make a second layer in the clip where the clip is loaded and say stop, Flash seems to ignore it.
Anyone can help?

View Replies !    View Related
Stop() Not Working In Loaded SWF
In a SWF file I have an empty MC which I load external SWFs. When one external SWF reaches the end, there is code on last frame telling next SWF to load. This is all working fine.

Problem is the stop() frame actions in the loaded SWFs is not working. I made simple test files and stop code works fine.

I tried putting this._parent.stop(); but this didn't work either.

Any ideas?

thanks
Dennis

View Replies !    View Related
Stop A Loaded SWF From Looping
i have a SWF file that i am loading into a MC in another Flash file. Is there a way to get that SWF to not loop? i do not have access to the source of the SWF so i cannot go into that and set up anything in there.

thanks in advance!
ggogis

View Replies !    View Related
Stop & Play A MC You Have Loaded Into Another MC
When my flash mc starts it loads an mc into an emty mc I named...
ie
loadMovie("nameofmcbeingloaded.swf", "mcbeingloadedinto");
that works fine, it loads the external mc into my flash mc. what I am trying to do is contol that mc that i have now loaded into another mc. I want to stop the loaded mc right away, and then when I click a button have it play... Here's what I was thinking with no luck;

_root.nameofmcbeingloaded.stop();
or
mcbeingloadedinto.stop();
or
_root.mcbeingloadedinto.stop();

I really have no clue how to control my loaded mc, I haven't created any variables or anything, iv'e litterally only loaded the clip just like i showed, and it works, but it plays and I cant stop or play it like I want to
thnx for your help....

View Replies !    View Related
How To Stop Flv Playback Before It Was Loaded?
I am working on a site that has a lot of video content. The problem I m facing is as follows:

When a video is requested to play and before the video can load or start to stream or play, the user changes the section, after a little gap, the video that was requested starts to play!

I m using flv.playing property to check it. If it s true, then i stop the flv playback component. The component is inside a movieclip that is animated. On unload section, the movie clip plays to its end where there is no flv playback component. Yet the flv starts to play coz it was not loaded nor playing, hence not stopped.

Is there some way i can stop all video content from playing like there was a way to stop all sounds in the previous versions of actionscript?

Please note: When i stop the video from playing regardless of it being loaded, then it throws an error!

Many thanks in advance.

View Replies !    View Related
Can't Stop Music In Loaded Swf
I have used Loader to load an swf which has looping music.

When I call unload - the music keeps playing.

Could someone please help me?

Code below:








Attach Code

var musicHolder:Loader = new Loader();
var requestMusic1:URLRequest = new URLRequest("music.swf");
musicHolder.load(requestMusic1);

// LATER ON

musicHolder.unload();

// music continues to play

View Replies !    View Related
Can't Stop Loaded Movie
This is a preloader problem. There's an external SWF, ext.swf, that has a LOT of symbols exported to the first frame. For this reason, a preloader built into external.swf won't show up until all those symbols are loaded. So I decided to make a separate preloader SWF that loads ext.swf.

My problem is that I can't reliably stop the movie once it's loaded. My preloader has a 'fade out' that gets run over by the external movie.

So here's what I've done:

// Frame 1
loadMovieNum("ext.swf",1);
_level1.stop(); // INEFFECTIVE; movie doesn't stop

// Frame 2
_level1.stop(); // INEFFECTIVE

// Frame 3
_level1.stop(); // WORKS EVERY TIME!

WHY is this happening? There's no ActionScript in ext.swf that would be causing it to play. I have no idea whether I can rely on Flash's ability to stop the movie if it isn't finished loading yet.

I've also tried the following for frame 1. Again, the movie won't stop unless the stop() command is issued on frame 3.

// Frame 1
this.createEmptyMovieClip("external");
this.external.loadMovie("ext.swf");
this.external.stop(); // INEFFECTIVE

Now, if that problem gets solved, the next one is how do I get Flash to simulate the long download caused by ext.swf? The "streaming" debug doesn't seem to apply to movies loaded with loadMovie. It's always instantaneous; always completely loaded, so there's no way I can find to test my preloader.

--
Jeff S.

View Replies !    View Related
AS3 - Having Problems Getting Loaded Swf To Stop
Hello my first post here hopefully someone can help me figure out why my code don't work. I have loaded in a swf file and in my actionscript I want to have actionscript tell that loaded swf not to play so i can add some buttons and what not to let the user choose to play it or not after it loads up. Here is my code Im working with and Something to note is I created the mainArea object outside this code.


Code:
var main_area:MovieClip = new MovieClip();
addChild(main_area);


# var mainLoader:Loader = new Loader();
# var mainRequest:URLRequest = new URLRequest("swf/"+ swf_file[0]);
# mainLoader.load(mainRequest);
# mainLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,mainLoad);
#
# function mainLoad(event:Event):void{
# // place postion on stage
# main_area.x = mainPlacementX;
# main_area.y = mainPlacementY;
# //add first file to stage
# main_area.addChild(mainLoader);
#
# main_area.gotoAndStop(1);
#
# // Resize
# main_area.width = main_area.width / 2;
# main_area.height = main_area.height / 2;
# }// End mainLoad function
Everything works fine except the main_area.gotoAndStop(1); doesnt seem to work cause after its loaded in plays when what im trying to is stop the swf from playing.


Anyone have a good solution/explination?

View Replies !    View Related
(stop / Play) Loaded Movie
Hi.

I load an external movie by using:

loadMovie ("movie1.swf", "_root.movieHolder");

where 'movieHolder' is an instance created to specify the location for the movies to be loaded... and it works fine.

Now, when I try to use some buttons from the initial movie to stop or play the movie loaded using this:

on (release) {
tellTarget ("_level1") {
stop ();
}
}

it doesn't work....x-(

Can someone tell me what the problem is?

View Replies !    View Related
Stop Looping A Loaded Movie
Hi again
I made a basic movie with baloons. One of the balloons is a button(first.swf); on mouseevent I load a movie on the same level, so first.swf disappears.

When clicking on this second.swf a third.swf is opening instead of the second.swf. This third.swf is supposed to stop at the end and showing a logo, but it starts and starts again with the second.swf.

I tried to put a stop in the second.swf....but then it stops at the end and this is not the meaning if somebody does not click to start the third.swf.

Can anybody help?

Thanks a lot!

View Replies !    View Related
START/STOP TIMELINE OF LOADED .SWF
hi all...

im having a hard time figuring out why this isnt working.

i have a button in my main movie on level0 that i want to control a loaded movie using loadMovieNum() on level5.

i simply want to use a start and stop command using the following:

on (release) {
_level5.start
}

or

on (release) {
_level5.stop
}

the loaded .swf on level5 is an .swf music file, created with swiffpeg. there are no stops at the start or end of the .swf.

any help?

thanks
eric

View Replies !    View Related
How To Stop Till Data Is Loaded?
Hi,
I have a movie that accesses ASp pages twice, once for loading teh data in azmovieclip at start ofmovie and another to update database with movie input text at end of movie. it works only at a very low frame rate also sometimes it doesnt work unless i publish movie and then view it in html. If i increase my frame rate to default 12 fps, it doesnt work, probably teh time of access to ASP is not small enuf to fot in higher frame rate.

the second time i do a loadvars.sendandload to update the database... how do i stop teh movie if data hasnt been loaded... when i increase the framerate...

Thnaks,
shilps

View Replies !    View Related
Making A Loaded Movie Stop
Ok guys I was wondering if you could help me out on stopping a loaded .swf file through the loadmovie comand. The problem is just that I loads perfectly but when I try to set a stop comman on the .swf file bein loaded it stops if I play that individual file but when I try to play the movie into witch I want to load it, the .swf file keeps on looping and I dont want it to do that. Also have tried previews fram on the .swf file bein loaded but that doest work either.

Thanks

View Replies !    View Related
Stop Re-loading An Already Loaded Movie
Is there a script that can cancel out re-loading a loaded .swf? i have 4 buttons which load 4 different .swfs, so when you click on button one, movie one loads, but if the user clicks on button one again the movie re-loads again...

how can i stop this so that it recognizes that that movie is already open?

thanks,
jondj24

View Replies !    View Related
Detect Stop(); In Loaded Movie ?
Is it possible to detect a stop(); command in an external loaded movie/swf?

Thanks,
Smalco

View Replies !    View Related
How To Stop An Externally Loaded Swf Clip?
Basically what I am doing is employing a reusable preloader. You have a screen, several buttons on it, you click a button and a swf clip is externally loaded onto the screen. The problem is the clip is looped and once loaded doesn't stop, unless you load another movie. So I have writen some script to prevent that and show the clip only once. I have underlined that part of the script. However, for some reason inclusion of this part of the script prevent a swf clip to get loaded in the first place... Any ideas? If you need any other info please tell me. Thanks!!!!!!!!

The Script

MovieClip.prototype.fadeIn = function() {

this.onEnterFrame = function() {

if (this._alpha<100) {

this._alpha += 10;

} else {

delete this.onEnterFrame;

}

};

};

clip_preloader._visible = false;

loading_text02._visible = false;

var empty = this.createEmptyMovieClip("container", "100");

empty._x = 240;

empty._y = 263;

my_mc = new MovieClipLoader();

preload = new Object();

my_mc.addListener(preload);

preload.onLoadStart = function(targetMC) {

trace("started loading "+targetMC);

container._alpha = 0;

clip_preloader._visible = true;

loading_text02._visible = true;

};

preload.onLoadProgress = function(targetMC, lBytes, tBytes) {

clip_preloader._width = (lBytes/tBytes)*100;

};

preload.onLoadComplete = function(targetMC) {

container.fadeIn();

loading_text02._visible = false;

clip_preloader._visible = false;

trace(targetMC+" finished");

};

preload.onLoadInit = function(targetMC) {

targetMC.onEnterFrame = function() {

if (this._currentframe == this._totalframes) {

this.stop();

delete this.onEnterFrame;

}

};

};

//default image

my_mc.loadClip("default.jpg", "container");

//buttons

slot01.onPress = function() {

my_mc.loadClip("clip01.swf", "container");

};

slot02.onPress = function() {

my_mc.loadClip("clip02.swf", "container");

};

slot03.onPress = function() {

my_mc.loadClip("clip03.swf", "container");

};

View Replies !    View Related
[F8] Stop & Start For Run-time Loaded Swf
How do we set up a stop and start for a run-time loaded SWF. The simple stop and start buttons we put into the loaded file don't work. Is there a way to target the loaded SWF? Any other way?

Thanks!

View Replies !    View Related
Stop External Loaded Swf From Playing
ok.. i have a button, when clicked,, it loads an external swf... when i click another button, another swf should play.. and it does.. till here.. its all good... problem is.. when i open the external swf.. and i click a button that has no external swf to be loaded in.. the swf doesnt go... it stays on top of the next frames...
so... i wanna know how to make the external swf stop when i click anywhere else!

thanks

Natalie

View Replies !    View Related
Help How To Stop Looping Loaded Swf File
Hi I’ve looked everywhere for a solution but I simply can't figure it out. Please help if you can, I'm new to flash and I’m coming up to a deadline where I’m am no where near finished thanks!

I'm making a character select menu and have buttons which load an external animated swf which shows a character profile within an empty movieclip.
I've placed the following code on the button

on (press) {
loadMovie("WB1.swf", "container");

Thing is the animation swf "WB1" loops, I've placed stop(); code at the end of the swf animation and even tried mc_WB1.stop(); as well as trying out placing the code in the character menu but no luck.
Any ideas or different approaches.

Thanks

View Replies !    View Related
Cs3 Help How To Stop Looping Loaded Swf File
Hi I’ve looked everywhere for a solution but I simply can't figure it out. Please help if you can, I'm new to flash and I’m coming up to a deadline where I’m am no where near finished thanks!

I'm making a character select menu and have buttons which load an external animated swf which shows a character profile within an empty movieclip.
I've placed the following code on the button

on (press) {
loadMovie("WB1.swf", "container");

Thing is the animation swf "WB1" loops, I've placed stop(); code at the end of the swf animation and even tried mc_WB1.stop(); as well as trying out placing the code in the character menu but no luck.
Any ideas or different approaches.

Thanks

View Replies !    View Related
Stop Loaded SWF From Resizing To Fit Container
I am really new to this, having recently decided to take up ActionScript 3.0 after years of Visual C++... I am having major troubles, the most recent being that I can't get a dynamically loaded swf to be the size that I want. Get this... The swf is x by y. I know the dimensions. I am not trying to make it scale to other dimensions. I am trying to KEEP it from scaling automatically. My app is dimensions w by h, and I load a swf of known dimensions x by y. For some reason, the result is a loaded swf that scales yet keeps it's aspect ratio: in this case, it scales until it fills up the y, leaving whiteness on both sides (x). Ok, I am using a Loader. I set width and height properties, and the swf doesn't load at all. I stuff it (the loader) into a sprite or movieclip and set the width and height; no swf. It only shows up on the screen if I let it do what it wants, which is to take over the whole app client area. HOW do I force it to stay the size that it is supposed to be? Better yet, can anyone tell me what good having a width and height property is if you can't set them without breaking your application? How does one create a container of a given width and height. Everytime I try to do it, the result is that the container doesn't exist.

Oh yeah, I forgot to mention - I am doing this in straight ActionScript 3.0 - no Flash IDE. I use FlashDevelop.

View Replies !    View Related
How To Stop The Sound In Loaded AVM1Movie?
I need to unload AVM1Movie and stop / remove the sound it was playing, but I cannot find a way to access the sound inside it.
Any suggestions are welcomed =)
TIA

View Replies !    View Related
Play/stop Dynamically Loaded Swf
I had this same question a couple weeks ago with an AS2 carousel, I have since changed it to AS3 and solved many of my problems, but I'm still having this one last problem before this will be complete. I need the swf that is loaded from the xml to play only once it has reached the front position. if it's not in the front position I need it to be stopped. Right now I have it playing on click, but I need it to just play when it gets to it's position.

Right now I have a function called checkFront that on complete of the rotation needs to check which movie clip is in the front and if its the swf, then play, but I don't know what names/variables to use. I'm having a lot of syntax issues, and I'm not exactly an actionscript guru, but I'm attempting to llearn! Any help would be awesome!

My Document class:
Code:
package {

import caurina.transitions.Tweener;
import com.becca.Carousel;
import com.becca.CarouselItem;
import flash.display.Bitmap;
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.events.KeyboardEvent;


public class CarouselDoc extends MovieClip {

// on stage of .fla
public var rightAd:MovieClip;
public var leftAd:MovieClip;
//public var right_mc:MovieClip;
//public var left_mc:MovieClip;
public var holder_mc:MovieClip;
public var loading_txt:TextField;

public static const XML_URL:String = "images.xml";

private var carousel:Carousel;
private var imageList:XMLList;
private var numImages:int;
private var currentImage:int = 0;


public function CarouselDoc():void {

carousel = new Carousel(500, 250, 220);
carousel.useBlur = false;
holder_mc.addChild(carousel);

stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
rightAd.addEventListener(MouseEvent.CLICK, leftClickHandler);
leftAd.addEventListener(MouseEvent.CLICK, rightClickHandler);
//right_mc.addEventListener(MouseEvent.CLICK, rightClickHandler);
//left_mc.addEventListener(MouseEvent.CLICK, leftClickHandler);

var uloader:URLLoader = new URLLoader();
uloader.addEventListener(Event.COMPLETE, xmlHandler);
uloader.addEventListener(IOErrorEvent.IO_ERROR, xmlHandler);
uloader.load(new URLRequest(XML_URL));
}

private function xmlHandler(event:*):void {
event.currentTarget.removeEventListener(Event.COMPLETE, xmlHandler);
event.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR, xmlHandler);
if (event is IOErrorEvent) {
loading_txt.text = "could not load xml file";
} else {
var xml:XML = new XML(event.currentTarget.data);
imageList = xml..image;

numImages = imageList.length();
loadImage();
}
}

private function loadImage():void {
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, imageHandler);
loader.load(new URLRequest(imageList[currentImage].toString()));

}

private function imageHandler(event:*):void {
event.currentTarget.removeEventListener(Event.COMPLETE, imageHandler);
event.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR, imageHandler);
if (event is IOErrorEvent) {
loading_txt.text = "could not load image" + currentImage;
} else {
var image:Loader = event.currentTarget.loader;
carousel.addItem(image);
}

if (++currentImage < numImages){
loadImage();
} else {
loading_txt.text = "";
}
}

private function rightClickHandler(event:MouseEvent):void {
carousel.targetRotation += 360 / carousel.numItems;
Tweener.addTween(carousel, { zRotation:carousel.targetRotation, time:1, transition:"easeInCubic", onComplete:checkFront } );
}

private function leftClickHandler(event:MouseEvent):void {
carousel.targetRotation -= 360 / carousel.numItems;
Tweener.addTween(carousel, { zRotation:carousel.targetRotation, time:1, transition:"easeInCubic",onComplete:checkFront } );
}
private function keyHandler(event:KeyboardEvent):void {

if(event.keyCode==37){
carousel.targetRotation -= 360 / carousel.numItems;
Tweener.addTween(carousel, { zRotation:carousel.targetRotation, time:1, transition:"easeInCubic",onComplete:checkFront } );
} else if (event.keyCode==39){
carousel.targetRotation += 360 / carousel.numItems;
Tweener.addTween(carousel, { zRotation:carousel.targetRotation, time:1, transition:"easeInCubic",onComplete:checkFront } );
}

}
private function checkFront(event:*) {


}

}
}
My XML:


Code:
<menuItems>
<item>
<image>pics/VS Home Page Animation.swf</image>
<link>http://www.ema-eda.com/training/seminars.aspx</link>
</item>

<item>
<image>pics/CadenceWebinar.jpg</image>
<link>http://www.cadence.com/cadence/events/Pages/allegro_webinar_series.aspx?CMP=cbnr20081006</link>
</item>

<item>
<image>pics/Class.jpg</image>
<link>http://www.ema-eda.com/training/orcadtraining.aspx</link>
</item>

</menuItems>

View Replies !    View Related
How To Stop A Timer In An Externally Loaded Swf?
Hi,

I have a project in which the main swf loads another into it. The swf that gets loaded has an xml driven slideshow that runs on a timer. To view what the timer was doing in the output I traced the name of each photo as the timer fired. When I unload the swf I've noticed that though it appears to be gone from the stage the timer continues to fire and the images are listed in the output. I know that I can stop a timer by using

ActionScript Code:
photoTimer.stop();
but I can't figure out how to stop the timer in an externally loaded swf. I'm using this code to remove the swf

ActionScript Code:
this.mc_content_box.mc_placeholder.removeChild(contentLoader);
I'm worried that the timer may be loading the photos in the background somehow and increasing the workload. Any suggestions would be greatly appreciated.

Thank you.

View Replies !    View Related
Play Once And Stop Loaded Movie
I am loading into a container MC multiple .swf's (QT videos compressed to SWF with Sorenson). I am able to the loadmovie and control its playback. However the SWF once "played" will loop until I press a "stop" button.

How can I get it to play once and stop.

I have looked all over and can't find a workable solution.

Thank you in advance for your patience and help.

Scott:

View Replies !    View Related
PAUSE Dynamically Loaded Mp3 (not Stop)
Hi all, I did a search and looked at tons of threads including Voetsjoba mp3 player.

This is way more complicated than what i need / want. i already have an mp3 player I've built that uses dynamic text (song title and track info) and variables to load an mp3 dynamically through .php & FlashVars. I only need 1 mp3 playing at one time and so this method works great for me. This way I can update it without going into Flash at all (but XML is overkill so no need for that either).

Thing is, I would like to have a play and stop button that actually stops and starts the track where it last was stopped / paused, rather than resuming from the beginning.

I also have built in a volume slider.

Here is the Actionscript I've been using:


ON VOLUME SLIDER MC [mySlider]:


ActionScript Code:
onClipEvent (load) {    mySound = new Sound();    mySound.loadSound(mp3Title,true);}onClipEvent (enterFrame) {    mySound.setVolume(_root.volume);}


ON PLAY BUTTON:


ActionScript Code:
on (release) {        _root.mySlider.mySound.start();}


ON STOP (PAUSE) BUTTON:


ActionScript Code:
on (release) {    _root.mySlider.mySound.stop();}


ON DRAGGER INSIDE VOLUME SLIDER MC:



ActionScript Code:
this.ratio = 0;dragger.onPress = function() {    this.startDrag(true, 0, 0, line._width, 0);    this.onEnterFrame = function() {        ratio = Math.round(this._x*100/line._width);            _root.volume = ratio;    };};dragger.onRelease = dragger.onreleaseOutside=stopDrag;


works ok, but like i said...stop does not "pause" the mp3 but rather stops it irrecoverably.

play starts from the beginning which I would like to avoid.

thanks in advance.

View Replies !    View Related
How To Stop An Externally Loaded Swf Clip?
Basically what I am doing is employing a reusable preloader. You have a screen, several buttons on it, you click a button and a swf clip is externally loaded onto the screen. The problem is the clip is looped and once loaded doesn't stop, unless you load another movie. So I have writen some script to prevent that and show the clip only once. I have underlined that part of the script. However, for some reason inclusion of this part of the script prevent a swf clip to get loaded in the first place... Any ideas? If you need any other info please tell me. Thanks!!!!!!!!


The Script

MovieClip.prototype.fadeIn = function() {

this.onEnterFrame = function() {

if (this._alpha<100) {

this._alpha += 10;

} else {

delete this.onEnterFrame;

}

};

};

clip_preloader._visible = false;

loading_text02._visible = false;

var empty = this.createEmptyMovieClip("container", "100");

empty._x = 240;

empty._y = 263;

my_mc = new MovieClipLoader();

preload = new Object();

my_mc.addListener(preload);

preload.onLoadStart = function(targetMC) {

trace("started loading "+targetMC);

container._alpha = 0;

clip_preloader._visible = true;

loading_text02._visible = true;

};

preload.onLoadProgress = function(targetMC, lBytes, tBytes) {

clip_preloader._width = (lBytes/tBytes)*100;

};

preload.onLoadComplete = function(targetMC) {

container.fadeIn();

loading_text02._visible = false;

clip_preloader._visible = false;

trace(targetMC+" finished");

};

preload.onLoadInit = function(targetMC) {

targetMC.onEnterFrame = function() {

if (this._currentframe == this._totalframes) {

this.stop();

delete this.onEnterFrame;

}

};

};

//default image

my_mc.loadClip("default.jpg", "container");

//buttons

slot01.onPress = function() {

my_mc.loadClip("clip01.swf", "container");

};

slot02.onPress = function() {

my_mc.loadClip("clip02.swf", "container");

};

slot03.onPress = function() {

my_mc.loadClip("clip03.swf", "container");

};

View Replies !    View Related
Stop Streaming MP3 Loaded Via LoadSound()
Hi everybody, need help.
The case: I have a "some.swf" which must load an external MP3 file passed him through a "some.php?song_id=xxx" file. Everything woks fine. I load that MP3 file via loadSound().
The matter: loading (not playing) of the external MP3 file should stop when "x" seconds of the MP3 file are loaded.

P.S. This is for a dynamic low-bitrate preview of an MP3 file for "x" seconds.

View Replies !    View Related
Stop Streaming MP3 Loaded Via LoadSound()
Hi everybody, need help.
The case: I have a "some.swf" which must load an external MP3 file passed him through a "some.php?song_id=xxx" file. Everything woks fine. I load that MP3 file via loadSound().
The matter: loading (not playing) of the external MP3 file should stop when "x" seconds of the MP3 file are loaded.

P.S. This is for a dynamic low-bitrate preview of an MP3 file for "x" seconds.

View Replies !    View Related
How To Stop LoadingMovie From Loading Again When It Is Already Loaded
I know I have created this before (just don't remember how I did it). So if someone can help it would be appreciated.

Much of the content on my website is via loadMovie (.swf) to a createEmptyMovieClip (in my main movie). I know how to do that.

What I would like is that once the loadMovie has taken place if the user happens to re-click the same button (while the loadMovie is still loaded) that it does not reload again.

Just to make sure that I am being clear here: In other words, the loaded movie has not been unloaded. It is still there, loaded up on my main movie. The way it is right now if the user happens to re-click on the same button that loaded the movie it will unload and reload again. I am (pretty) sure that there is a way to keep that from happening. I just don't recall how.

Thanks.

View Replies !    View Related
How To Stop Sound Of Loaded Movie..?
hi
am loading a movie in a main movie
how can i stop the sound of the loaded movie from the main movie.

i cant use attachsound because the sound is not in the main movie...
if you ve an idea please tell me
thanks

View Replies !    View Related
How To Stop An Swf Loaded With LoadClip Method?
Hi,

I decided to take advantage of the loadClip method to load an external swf in a placeholder MC, called "interHolder".
Everything works great except that I can not seem to get the external swf file to stop or go to a specific frame which is crucial for the application I'm building.
I can't figure out what I'm doing wrong. I tried the obvious methods like _root.interHolder.stop and _root.interHolder.gotoAndStop(1) and the not so obvious like StopPlay() etc ....
Below is the code I'm using. Anyone has the same problem? This seems like a major bug to me....

Thanks!! Steven

[AS2]
var my_mcl = new MovieClipLoader();
myListener = new Object();

myListener.onLoadInit = function (target_mc) {
// myMovie.swf loaded - now correct the dimensions
// this works ----------
target_mc._width = 320;
target_mc._height = 240;
target_mc._x = 39;
target_mc._y = 149;
target_mc._visible = true;

// this doesn't!! -------
target_mc.stop();
target_mc.gotoAndStop(1);
}

my_mcl.addListener(myListener);
this.attachMovie("holder","interHolder",100);
interHolder._visible = false;
my_mcl.loadClip("myMovie.swf","_root.interHolder");
[/AS2]

View Replies !    View Related
Stop Scaling Of Second Loaded Movie...?
stop scaling of loaded movie
ok here is what i want to do:

1. have parent movie 100% x 100% in browser window
2. load second .SWF on layer 2
3. *NOT* have second.swf scale.. ie. if it is 300 x 300 pixels to stay that size no matter what size the users scales the browser window to?

I found this resource:
http://www.actionscript.org/tutoria...tomatic_Resize/

but it's rather buggy [as javascript talking to flash movies is buggy at best on macs and sucks on 4.0.1 browser types] and dosen't work with some browsers. I have read about another method. "onResize" in Flash MX you can set up Listeners to detect the parent flash movie size. I'm not a "coder" so any help would be appreciated! I'm sure others can benefit from this as I'm not the only one looking for this!! thanx.

View Replies !    View Related
Stop Scaling Of Loaded Movie
ok here is what i want to do:

1. have parent movie 100% x 100% in browser window
2. load second .SWF on layer 2
3. *NOT* have second.swf scale.. ie. if it is 300 x 300 pixels to stay that size no matter what size the users scales the browser window to?

I found this resource:
http://www.actionscript.org/tutorial...omatic_Resize/

but it's rather buggy [as javascript talking to flash movies is buggy at best on macs and sucks on 4.0.1 browser types] and dosen't work with some browsers. I have read about another method. "onResize" in Flash MX you can set up Listeners to detect the parent flash movie size. I'm not a "coder" so any help would be appreciated! I'm sure others can benefit from this as I'm not the only one looking for this!! thanx.

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