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




AS 2 Xml Slideshow Lost Its File Paths While Being Repeatedly Load/unload Several Times



Kirupa's xml-flash slideshow works fine when it is being implemented on its own timeline. I made a sample project and externally loaded this slideshow by calling it thru loadMovie(). In the file that I've provided, you will see that once you've clicked the loadMovie button the slideshow is being loaded on the left side of the stage with no error. The problems arises when you unloads and loads the movie repeatedly. The slideshow's transition effects jumps too fast from one image to another, as if the image sequencing is gone. And if you test and try to click the buttons for more load and unload operations you will end up seeing the "Error opening url - file://undefined" - as if the movie cannot keep up with the phasing of button's events!Here's the codes:In XML:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?><images> <pic> <image>pic1.jpg</image> <caption>Picture 1</caption> </pic> <pic> <image>pic2.jpg</image> <caption>Picture 2</caption> </pic> <pic> <image>pic3.jpg</image> <caption>Picture 3</caption> </pic> <pic> <image>pic4.jpg</image> <caption>Picture 4</caption> </pic></images>
Inside .FLA:Main Movie:
Code:
bigRed_btn._visible = false;txtMovieNotLoaded._visible = false;//Load MoviebigBlue_btn.onRelease = function () { loadMovie("slideshow.swf", slideshowHolder_mc); bigBlue_btn._visible = false; bigRed_btn._visible = true; txtMovieNotLoaded._visible = false; }//Unload MoviebigRed_btn.onRelease = function () { unloadMovie(slideshowHolder_mc); bigRed_btn._visible = false; bigBlue_btn._visible = true; txtMovieNotLoaded._visible = true;}
In "Slideshow.swf":
Code:
var delay:Number = 3000;//-----------------------xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; image = []; description = []; total = xmlNode.childNodes.length; for (i=0; i<total; i++) { image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue; } firstImage(); } else { content = "file not loaded!"; }}xmlData.load("images.xml");// ///////////////////////////////////listen = new Object();listen.onKeyDown = function() { if (Key.getCode() == Key.LEFT) { prevImage(); } else if (Key.getCode() == Key.RIGHT) { nextImage(); }};Key.addListener(listen);previous_mc.onRelease = function() { prevImage();};next_mc.onRelease = function() { nextImage();};// ///////////////////////////////////p = 0;this.onEnterFrame = function() { filesize = picture.getBytesTotal(); loaded = picture.getBytesLoaded(); preloader._visible = true; if (loaded != filesize) { preloader.preloadBar._xscale = 100*loaded/filesize; } else { preloader._visible = false; if (picture._alpha<100) { picture._alpha += 10; } }};var myInterval;function nextImage() { p++; p %= image.length; if (loaded == filesize) { picture._alpha = 0; picture.loadMovie(image[p], 1); desc_txt.text = description[p]; picture_num(); clearInterval(myInterval); if (playing) { slideshow(); } }}function prevImage() { clearInterval(myInterval); if (playing) { slideshow(); } if (p>0) { p--; } else { p = image.length-1; } picture._alpha = 0; picture.loadMovie(image[p], 1); desc_txt.text = description[p]; picture_num();}function firstImage() { if (loaded == filesize) { picture._alpha = 0; picture.loadMovie(image[0], 1); desc_txt.text = description[0]; picture_num(); clearInterval(myInterval); if (playing) { slideshow(); } }}function picture_num() { current_pos = p+1; pos_txt.text = current_pos+"/"+total;}function slideshow() { myInterval = setInterval(pause_slideshow, delay); function pause_slideshow() { clearInterval(myInterval); nextImage(); }}stop.tt.text = "STOP";play.tt.text="PLAY"playing = trueplay.onPress = function(){ playing = true nextImage() }play.onRelease =play.onReleaseOutside= function(){ this.gotoAndStop("_disabled") this.enabled = false}stop.onPress = function(){ playing = false play.enabled = true clearInterval(myInterval)}
But it is better if you look for the attachment files -->



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 07-12-2008, 03:29 PM


View Complete Forum Thread with Replies

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

Mac File Paths To Load Swfs Off CD
I keep searching for an example of file paths for the Mac for a project I am developing. For some reason there is very little info, and as a PC person, I don't know the logic behind this.

I have created a projector (one for Mac, one for PC) which loads .swf movies into itself off a CD. Last Mac fix I did, I made a condition to load from the CD depending on version:

this worked for Mac 9.x:
loadMovie("file:///CDname/swfname.swf", "cdplacehold");

this for Mac 10.x:

loadMovie("file:///Volumes/CDname/swfname.swf", "cdplacehold");

This worked, once I found out that you needed "Volumes" to locate the CD on Mac OS X.

For some reason, perhaps an update or version change, Mac OS 10.3 is no longer connecting with the above code.

I found by experimenting that this will do it:
loadMovie("/CDname/swfname.swf", "cdplacehold");

My question is, when did the OS change the necessary path to exclude "volumes"? I could add more conditions to alter the path based on Mac OS version, but I don't know which version or update made this change. I am hoping to make the projector/CD work for as many Mac users as possible.

Can anybody give examples of Mac CD paths for the different versions?

Thank you for your help.

Lost In Paths
me again.

if i load a swf file from a folder into a main file, it looses its path to the objects that should be loaded. is there a function, an anything that gives me the possibility to tell my little swf file to load from the folder itself has been loaded from,.....without hardcoding the ************....????






......watch your back, i m right behind u.....

dephil

ps soll ich mal lachen? instead of taking care of the pc,....what about spreading a little bit of your wisdom monsieur bleu????????????

How To Smart-load Same File Multiple Times?
i'm making a game where it loads the same image into 16 different game tiles. this image needs to be dynamic becuse it changes throughout the game and from day to day.

the problem is the image is actually being loaded 16 times rather than loading once and using the cache for the rest. i tried having one piece load first then loading the other 15 later, but the same problem occurs.

each of the game tiles has a different mask in it, so i can't simply duplicate the game tile movie clip 15 times.

is there a way i can just load the image once then tell all the game tiles to use this image?

any insights greatly appreciated.

Paths Are Leaving Me Lost
Hi Folks,

I have a bit of a problem that seems really really basic, but I just can't get it too work!!

I am importing data from a text file and displaying it in a 'movie clip-button'. So far so good.

My problem occurs when I try to put an 'if' statement in the code to test if the variable that displays the particular code exists or not. If it does not exist, I simply want the mc-button to not be displayed.

I couldn't figure out how to remove the mc entirely, so I thought I would be sneaky and just have it display off of the stage if the 'if' statement resolves to TRUE.

I can get the text to appear in the mc, and I can get the button to move, but I can't seem to target the variable properly with the 'if' statement. This is the code I am using:


Code:
loadVariables("text.txt", "btn1");
loadVariables("text.txt", "btn2");
loadVariables("text.txt", "btn3");
loadVariables("text.txt", "btn4");

//Test For Button 1
if (btn1.btext1 == undefined) {
setProperty(btn1,_x,90);
}
'btn1' is the instance name of the mc
'btext1' is the variable

Why is this seemingly basic code not working? Also, if anyone has a suggestion how to remove/delete the mc entirely from the stage, rather then simply moving it off, please let me know

Thanks again folks!

PNGs - Does It Help Reduce File Size/load Times?
Hello,

Does taking several hundred assets & converting to one large PNG (then splice in Fireworks) help when used on a page for internet as far as making it easier to download or making it more stable instead of several hundred assets to download in Flash?

I did try it and the load time file size appears the same, visually it looks the same but now I hardly have any assets to load. Is there a benefit to doing it this way? And are there any special settings to use when using PNGs for the internet. Can old/new computers see them the same way?

thks.

Sound Plays On Load Repeatedly
Hi, I'm trying to make a basic music player for a portfolio that allows you to switch between 3 tracks, change volume and mute the tracks, so far I'm only just trying to load the sounds and play them but already have a problem.
The sound seems to play, then start again over itself, building up until it's a garbled mess. Code I have is here:

Code:
var soundReq1:URLRequest = new URLRequest("dev_files/track1.mp3");
var soundReq2:URLRequest = new URLRequest("dev_files/track2.mp3");
var soundReq3:URLRequest = new URLRequest("dev_files/track3.mp3");

var track1:Sound = new Sound();
var track2:Sound = new Sound();
var track3:Sound = new Sound();


track1.load(soundReq1);
track2.load(soundReq2);
track3.load(soundReq3);

track1.addEventListener(Event.COMPLETE, track1Play);

function track1Play(event:Event):void
{
track1.play();
}
Do I have to add something to stop the track from playing everytime track1Play completes loading? I'm following Lynda.com tutorials for this and this code is pretty much exactly the same to what was in the tutorial.

My Flash File Loads Repeatedly.... Looping
My flash file loads repeatedly. It has to stop after loading initial frames. But it doesn't. I guess i need to set the looping to false. I couldn't find it in the flash MX.
Can anybody know how to turn it off?

siva

Load And Unload External .swf File
Hi there does anyone know how to load an m1.swf file into main.swf file, without any click?I mean just by timeline
I also need to unload it when click on any other button inside main.swf

Paths In Slideshow Using Xml
Hello there,

I have recently completed the tutorial on how to make a slideshow with thumbnails. It is found here: http://www.kirupa.com/developer/mx2004/thumbnails.htm . I figured this would be a great way to show off a friends photogallery. The site is viewable here: www.prestigeinteractive.com/anneliephotography .

Well I can get it to work, however, when I try to load the swf file into another fla, the paths are messed up. Sadly, I am not good with code, so I am wondering what lines would need to be fixed in order to make this code work?

First I will tell you how I've structured the site.
- I have a swf file that basically loads a bunch of swf files into their appropriate x y coordinates.
- I have buttons that when selected open up external swf files into a movie clip called siteContentPage_mc . (this is where the site's content is loaded)
- On one page that is called portfolio, I want to have my slideshow photogallery page load. I am wondering how I would have to modify the code to make it work in this setting. I know it has to do with paths, but I am not sure which one's need changing. Currently the xml file resides in the folder with the swf files.

Here is the code at this time.


Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}

function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}

If you wouldn't mind explaining why certain ones are altered and others are not...that would be great.

Thanks in advance,

Greg

Somwhat Lost On Xml Slideshow
Here's the AS:

Actionscript Code:
function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        image = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
        }
        randomImage();
    } else {
        content = "file not loaded!";
    }
}
showStarted = false;
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images/images.xml");
 
this.onEnterFrame = function() {
    filesize = fadingPeople.getBytesTotal();
    loaded = fadingPeople.getBytesLoaded();
    percentLoaded = 100*loaded/filesize;
    preloader._visible = true;
    if (loaded != filesize) {
        preloader.preload_bar._xscale = percentLoaded;
        } else {
        preloader._visible = false;
        if (fadingPeople._alpha<100) {
            fadingPeople._alpha += 10;
        }
    }
}
 
function randomImage() {
if (showStarted = false) {
    if (loaded == filesize) {
        fadingPeople._alpha = 0;
           numberSelected = random(total);
           fadingPeople.loadMovie(image[numberSelected], 1);
    }
    showStarted = true;
} else {
    fadingPeople.loadMovie(image[numberSelected]+1,1);
}
}

What I'm needing to do in a nutshell is choose a random starting point along the xml list each time, but then follow in order go back to the beginning when it reaches the end.

Pretty lost and not understanding why basic if statements aren't working. ANY kind of help is appreciated.

New York Times Slideshow
Does anyone know where I can find a tutorial to make a scroll bar to control photo slideshows like the ones used in the New York Times multimedia projects? Here is an example of what I mean:
http://www.nytimes.com/packages/khtm...EATURE.html?HI

Some questions:
- Do you think the slideshow is an external movie that they load using loadmovie?

- Ideally the images would be loaded using XML for efficiency, but how would the scroll control the audio then?

Thanks,
-DF

New York Times Slideshow
Does anyone know where I can find a tutorial to make a scroll bar to control photo slideshows like the ones used in the New York Times multimedia projects? Here is an example of what I mean:
http://www.nytimes.com/packages/khtm...EATURE.html?HI

Some questions:
- Do you think the slideshow is an external movie that they load using loadmovie?

- Ideally the images would be loaded using XML for efficiency, but how would the scroll control the audio then?

Thanks,
-DF

[F8] Please Help -Slideshow - XML - What Paths Need To Be Changed?
Hello there,

I have recently completed the tutorial on how to make a slideshow with thumbnails. It is found here: http://www.kirupa.com/developer/mx2004/thumbnails.htm . I figured this would be a great way to show off a friends photogallery. The site is viewable here: www.prestigeinteractive.com/anneliephotography .

Well I can get it to work, however, when I try to load the swf file into another fla, the paths are messed up. Sadly, I am not good with code, so I am wondering what lines would need to be fixed in order to make this code work?

First I will tell you how I've structured the site.
- I have a swf file that basically loads a bunch of swf files into their appropriate x y coordinates.
- I have buttons that when selected open up external swf files into a movie clip called siteContentPage_mc . (this is where the site's content is loaded)
- On one page that is called portfolio, I want to have my slideshow photogallery page load. I am wondering how I would have to modify the code to make it work in this setting. I know it has to do with paths, but I am not sure which one's need changing. Currently the xml file resides in the folder with the swf files.

Here is the code at this time.

Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}

function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}

"LoadMovie" Paths Lost When Imported As SWF(level1) Onto New Movie(level 0)
Hi there. (Using FlashMX)
I have a movie (buttons.swf)which uses following to load series of images; --> loadMovie("a1.jpg","mc"); this works great.

When new movie (menu.swf)-in different directory- is used to load "buttons.swf" onto level 1 -error appears and images not displayed since path is no longer the same. - an absolute path is required!!!!!

How can I tell (buttons.swf) to not use (menu.swf)current directory - instead retain the original.

Big issue as I need 2000 buttons and no way i will set absolute paths to all!!!! - this system in theory should work by it's generic format?

Very much appreciated if anyone can help.
Thank you.

Juan
juan@imagetools.com.au

NY Times-style Audio Slideshow With Draggable Slider?
Greetings all! I'm a newbie to actionscript, though I've been working with Flash for several years now...

I have about a month to research how to create an Audio Slideshow, exactly like the ones found here: NYTIMES AUDIO SLIDESHOWS

For those who can't see the above, each slideshow basically features an audio presentation with a draggable slider, along with a fading photo slideshow (which is also controllable with the slider).

Are the nytimes.com slideshows embedded videos, or are they simply keyframed clips with the audio synchronized built entirely in Flash? In any case, what are the advantages of using either method?

Any pointers to tutorials would be appreciated!

Unload XML? Multiple XML Instances Degrading Slideshow
Hi All. XML is really giving me problems.

I'm working in an all flash website done in flash 8.
I've got a xml slide show (code below, based I think off the one on kirupa) that works.
I've got my main index.swf and when I press the "photo" button, I loadMovie in photo.swf into holderMC. Within photo.swf I am loading the xml for a slideshow. Everything here works. The problem arises when I press another button in index.swf and load a new .swf into holderMC where my slideshow was and then re-load photo.swf into holderMC (Most notably when done in quick succession).

When I reload photo.swf into holderMC the xml file hasn't unloaded/reloaded and therefore the slideshow becomes "glitchy". When I look at the Activity Moniter in my web browser it shows that the xml file hasn't unloaded when I load another .swf into holderMC. Also, each time I load photo.swf it adds another instance of the xml file into the browser's cache. The glitchy part affects the slideshow playback/functionality. Instead of smooth transitions with a setInterval pause the pictures loop through at varied time intervals or just flicker suggesting that the slideshow is trying to access the multiple versions of the xml file?

I guess I am confused at how to make the slideshow function properly each time photo.swf is loaded (i.e. load xml file when photo.swf is loaded and unload xml file when photo.swf is unloaded. unloadMovie does not unload the xml file.

Thanks for your help.

The following code is placed in frame 1 of photo.swf and the pictures within are loaded to "backPic" movieclip from the xml file. Also, when firstImage() is run, it loads in x amounts of the first image where x = the total number of images in the xml file. How do I fix that?

function loadXML(loaded) {
if (loaded) {
//xmlNode = this.firstChild;
xmlNode = this.firstChild.childNodes[0];
image = [];
//description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
//description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
firstImage();
}
// Set Item Title
titleTxt = this.firstChild.childNodes[1];
txtPath = titleTxt.childNodes[0].firstChild.nodeValue;
titleWords();
}
else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml/photo/davis.xml");

// Time Delay
pg = function() {
if (p<(total-1)) {
if (loaded == filesize && l1 == f1) {
nextImage();
}
}
else {
if (loaded == filesize) {
firstImage();
}
p=0;
}
}

picGo = setInterval(pg, 7000);

/////////////////////////////////////
p = 0;
g = 0;
this.onEnterFrame = function() {
filesize = backPic.getBytesTotal();
loaded = backPic.getBytesLoaded();
preloader._visible = false;
if (loaded != filesize) {
preloader.visible = false;
//preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (backPic._alpha<100) {
backPic._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
backPic._alpha = 0;
backPic.loadMovie(image[p], 1);
backPic_num();
}
}
}

function prevImage() {
if (p>0) {
p--;
backPic._alpha = 0;
backPic.loadMovie(image[p], 1);
backPic_num();
}
}

function firstImage() {
if (loaded == filesize) {
backPic._alpha = 0;
backPic.loadMovie(image[0], 1);
backPic_num();
}
}

function titleWords() {
if (loaded == filesize) {
this.itemInfo.itemTitle.text = txtPath;
}
}

function backPic_num() {
current_pos = p+1;
}

Lost Original Flash File, Need To Open/Edit My .SWF File
I need to edit my .SWF file. I don't have the original file created in Flash5. Can I open and edit my .SWF file?

Thanks!
Randall

Load Times
Try this url:

http://ed.gamegeared.com/portfolio/page2.html

Could you tell me what connection you are on, how long it takes to load (didn't notice, wee while ect..) and also if the percent bar moves.

Load Times W/ Exported MCs
flash 5.0

i have a thumbnail<>fullsize picture movie, and would like the thumbs to be loaded before the fullsize pics (so the user doesn't have to wait). however, all the fullsize pics are in MCs set to Export, so it loads the lot of them in the first frame, before it starts the movie. how can i make them wait or change the load order?

..russ..

Help...load Times Too High
OK, need serious help here...

A client of ours has some Flash demos on their website my company is building.

Click Here and notice how quickly it loads. This is 3.5 MB and was provided to us by the company.

Now,

Click here and see how long it takes for THIS one to load. This one is only 2.5 MB and our company built it out of screenshots and WAV recordings given to us on a CD.

I was told that it takes too long to load so I put up a preloader for some visual feedback.

Still takes too long, I am told, and this filesize is a whole meg smaller than the quickly-loading one!

I've already got audio set to Streaming, Speech 11 KHz, and the picture quality is set at 30 in the publish settings.

How can I get these filesizes down so they stop complaining?

Load A .jpg Multiple Times
Heylo!

I'm currently working on a webshop in flash and i ran into the following problem.

I want to display all the product with their images on a page. On the same page i want a small list with 'popular purchases'. Generating the products is no problem. When i want to generate the popular purchases list, the pictures wont show. I think its got something to do with the fact that flash already loaded the pictures for the product list. Anyone got an idea to fix this? Thanks!

Differnt Load Times
I am wondering if there is anyone that knows of a way to program a page to load differently depending on the time of day. Basically I need one movie for the daytime and a different movie for the night. This will hopefully be done in flash with the same or two movies.


Thanks for any idea’s.

FLV Looong Load Times
hi there,

i'm working with about 10 different small clips 0:43 to 4:00 in length that i convert with Flash Encoder 8 from FCP. i upload them to my client's site and go to view them, but all i get is a white box while they load up, and that takes a few minutes. how can i get my small FLV files to play immediatly? i've converted them to Quicktime MP4's and they stream pretty much immediatly. here's the page that they're on - www.alexnussbaum.com/clips.php

thanks in advance
Craig

User-Indicated Load Times
I'm trying to develop a Flash music player for my website, but I don't want all the songs to load at once. I only want them to load if the user clicks on it. An example of this is a site that offers these, http://www.radioblogclub.com.

Anyhoo, I don't want to use a Radio Blog because I'd like mine completely customized to my specifications.

On to the actual queston: How do I make it so that a song in the music player will load only if a user wants it to load and clicks on it?

I think the starting code would be something like...

on(release){

:

Any help?

By the way, I'm using MX 2004, if it affects anything.

User-Indicated Load Times
I'm trying to develop a Flash music player for my website, but I don't want all the songs to load at once. I only want them to load if the user clicks on it. An example of this is a site that offers these, http://www.radioblogclub.com.

Anyhoo, I don't want to use a Radio Blog because I'd like mine completely customized to my specifications.

On to the actual queston: How do I make it so that a song in the music player will load only if a user wants it to load and clicks on it?

I think the starting code would be something like...

on(release){

:

Any help?

By the way, I'm using MX 2004, if it affects anything.

Load Times Under 100mbps
Hey out there;

Situation: Today at work i tried to download one of my movies on their high speed connect - showing 100mbps. Size movie i was trying to download - 2.49 mb. After 2 minutes I stopped trying. Countdown indicated about another minute to go, but already, 2 minues was toooooo long.

I'm stuck on dial-up, very little broadband experiance.

So my question: when something says the connection is 100mbps and i'm trying to download 2.49mb, is that download time of over 2 minutes... normal?

If it isn't, any idea what might be happening?

Hoss

Load External Images Once, Use Many Times
Hey all,

What I have is a simple logo scroller (kinda like a banner rotator), it rotates through 5 external images using the loadMovie function. The problem is: this movie sits on our intranet home page and many users will leave that page up all day. Well, everytime the movie calls the next jpeg = more traffic, like almost an extra 10 gigs of traffic last month (just for that little bitty flash movie).

How do I, can I, load these images once and use them without making additional loadMovie calls? I have a XML file that has the logo src and link to info. I'd like to keep the movie dynamic so our admin can update the scroller by updating the XML file.

Hopefully this is an easy one

Thanks in advance.


Action Script:
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("logo_scroller.xml");
slides_xml.ignoreWhite = true;

//
// Show the first slide and intialize variables
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);

}
}
//
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
// Fades in the new image
targetClip._alpha = 0;
fader = setInterval(fade,100)
function fade(){
targetClip._alpha += 10;
if(targetClip._alpha >=100)
clearInterval(fader);
}
// Sets values for movie vars
imagePath = newSlideNode.attributes.jpegURL;
URLTarget = newSlideNode.attributes.URLTarget;
slideText = newSlideNode.firstChild.nodeValue;
targetClip.loadMovie(imagePath);
}
//
obj = new Object();
obj.interval = function(){
//this is where you will advance your movie to the correct node


nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
} else {

currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}


// set the time interval between images
setInterval(obj,"interval",5000); //5 seconds
time = new Object();
function (time){
getTimer();
if (time >=10000){
delete (obj);
}
clearInterval (interval);
}

Long Load Times I'm A Noob
Hi All!!!

Yes, I am a newbie to Flash. I just installed MX pro and did my first application. It seemed very simple. It was an image with "fade in" transistion, and 2 sound files. It's 15 frames, very short.
I also use FrontPage 2003 and it tells me that the load time would be 4 minutes with a 56K modem. I can't even preview it in FrontPage and I'm on a cable modem.
Am I missing something here? Why such a long load time for such a simple application?
Help? Please?

Thanks!
J

Use Movie Six Times But Load It Just One Time
Hello

I want to use one Movie in one scene six times as ab background in six other movies. Every of this six movies has its own instancename. The movie, which i want to use as the background should be loaded from an external place. As an swf. If i load the swf into the six movies it takes a long time because the swf is loaded six times. How can i avoid this. I mean how can i load the swf just one time an then use it in six diffrent movies.

Thanks
Asta

Streaming Sounds And Load Times
Hey, i am designing a site for a kids cartoon and there is a place on the site where they can listen to some of the theme songs and whatnot through a jukebox. I have it set up now so i just imported the mp3 files into the flash project and dragged them into the movieclip where they need to be. This seems to make the file significantly larger and the load time a lot higher....is there a way to stream sound through? so they don't have to be saved into the project? just have the project call an xml file that will point to the different sound files?


or is there any better way to do it? thanks guys

Using Variables To Load Button Paths
I am using flash mx and I have a movie where I am using the code :


Code:
stop();
loadVariablesNum("txt/top5.txt", 0);
then, the txt file loads


Code:
&1cap= resident evil
&2cap= Mega man
&3cap= Devil May Cry
*1cap, 2cap and 3caps being the variable dynamic textfields. This works fine, my question now is:

Is there a way that I can make the button paths change in a txt file as well?

I tried adding an instance name to the button, with


Code:
&1snkpath=http://www.theirsite.com/kof2k2.htm
in the txt file, but it didn't seem to want to cooperrate.

Any help would be greatly appreciated as I am not very familiar with actionscripting and have very little time to complete this project before i just have to convert it to html and cut my losses.

Load Movie And Folder Paths
Hi All,

This is a small question related to loadmovie and paths to folders from where the movies are being called.
I have a main movie lets say A.swf which is loading another subsection say B.swf. I am using loadmovie to achieve this.
Now, in B.swf i am loading another movie C.swf , again using Loadmovie method. A.swf is in the root (D:) and B and C are in a folder called 'sub' in D drive.(D:sub)
What should be the path (syntax) in B.swf to load the file c.swf, such that
1. even when i run a.swf it should load b which inturn should load c
2.Even when B.swf is independently run it should load C.

Thanks in advance. Experts, please do help!!

File Lost Please Help...
I was working in flashMX and tried to save my file and got an error message that said save failed. I tried to rename it and save it and got the same message. The entire .fla file is now gone. I did a search on the computer and nothing came up except the .swf.

Please tell me there is a way to recover this! Otherwise hours of work will be flashed down the toilet.

I'm stressin big time please help!

Thanks in advance...

Help Lost File
somehow using my flash drive I lost the fla file but still have the swf file. Does anyone know if there is a way to go from swf to fla?? Really don't want to do this over.

Lost Cab File?
my brother has been trying to add some files to flash mx and has some how deleted a few cab files, we get an error for cab 2.

is there somewere HE can download them from?????

thanks

Help Lost .as File
I built a shopping cart system awhile back , and in it I used a form validation script that I got from somewhere.
The client wanted some changes to the cart, but when I went ot export the movie, the Form.as file was missing.
I had built the cart using Flash MX, and when I upgraded to 2004, I removed MX and with it the only copy of that Form.as file, it was in the include folder....
the problem is I don't remember were I got that script from.
If anyone knows of a form validation script that uses an external as file called Form.as
Please give me a link so I can check to see if it is the one I used. It is a MX script, AS 1
Thanks

File Paths And XML
Here's a question for ya regarding file paths...

I have a flash movie with a scrolling list of the names of 39 English Counties.

Each of the buttons on the scrolling list calls upon a new movie onto a new layer using loadMovNum (e.g. oxford.swf). These swf movies are located in 39 separate folders named after each of the counties (the path being oxford/oxford.swf or dorset/dorset.swf).

This works fine bringing in the new swf movie, but the problem I'm having is when one of these new movies needs to access an xml file in the same folder. (e.g. oxford.swf is trying to find images.xml using:

xmlData.load("images.xml");

How do I change the actionscript so that the file knows that the xml file is in the same folder each time a new 'county' movie is called in? It works fine otherwise.

Hope this makes some sense!

File Paths
Hi

Is it possible to tell flash in action script to locate a .swf file that is in two folders above where the main.fla is located.

For example, say my main fla was in folder C how do I tell flash to go back two levels to look for a file. I just refer to the full path as this won't work when its uploaded to a server.

C:/folderA/folderB/folderC

Every example I've seen the folders are usually at the same level as the main fla so they can be located using the /foldera/folderb/test.swf

Thanks

Ricky55

Load, Unload, Load... Will The Movie Need To Download Again?
hi,

I have a quick question about loadMovie and unloadMove...

If I load an external movie (section 1), lets say its 200k, and then unload it when the user moves to another section (section 2).

When returning to section 1, when the external movie is called to load, will it need to redownload? Or is it saved in some type of cache area?

any help or a point to a resource would be great.

thanks,
alex

Load Play Unload Load Problem
Ok subject heading isn't the best but hey. Okay here is my question. I have created a small animation in Swish. Then created my site base in flash MX, now I want to combine the two. So I created a 3rd file again in flash. Now the swish is the intro (was easier to animate) so it is intro.swf at present. The site is site.swf and the 3rd file holding them together is base.swf.

Anywho, Base.swf loads, now I want it to load intro.swf, then when intro.swf finishes playing, I want site.swf to load.

base.swf has a empty mc in it called mtClip. I can get the intro.swf to load into this easy enough. But have no idea on how to get it to once finished playing unload and load site.swf.

Let me know if this should be directed at the Swish help section. But personally thought flash being more powerfull should have some function i can't find to deal with this problem of mine.


Thank heaps in advanced

Trent

Script To Load Movie At Specific Times
I've got a simple flash-based .exe that I'd like to load and play a move between a certain time of day. For example, the loaded movie should play everyday between noon-1pm and 2am-3am. The movie should then unload and go back to the original movie at the end of each time period. How and the world do I write the script for this?

Play Movieclip At Random Times On Load.
Is there an actionscript to play a movieclip at random times? This is when it reached the end frame of the timeline. Thanks in advance.

Dre.

Play Movieclip At Random Times On Load.
Is there an actionscript to play a movieclip at random times? This is when it reached the end frame of the timeline. Thanks in advance.

Dre.

Lost Flash File
I made a cd for backup and by mystake i choose the joliet format to burn my cd. I delete my original file without checking the cd (yeah i know pretty dumb). Now all my flash file from the cd give me an unexpected format (mac or pc).

After trying to recover from my drive or to look at any place i could have put the file (ftp,co-worker)i'm at the point of asking you something i tough i would never ask simply because i think that people that ask that question are more then often code ripper.

But is there a tool that let you recreate a flash file from the swf?

What i have found let me extract image and sound but there is no such thing in the flash id like to extract it is mostly code and flash mx 2004 component.

there is the file id like to extract.

http://www.bungalowproductions.net/m...mangeImage.swf

So now i would be pretty stupid to put the link if it was not a file that i coded. But if anyone is successfull at ripping my stuff and give me back a flash file or let me know a way to do it without the pain of recoding it. I will give you the backend, xml and db of this online image manager with pleasure.

And if anyone know how to open a flash file that was burn on a cd with joliet format. It would be even better.

Any help would be apreciate.

Thank you!

Help Me Find My Lost .as File
I built a shopping cart system awhile back , and in it I used a form validation script that I got from somewhere.
The client wanted some changes to the cart, but when I went ot export the movie, the Form.as file was missing.
I had built the cart using Flash MX, and when I upgraded to 2004, I removed MX and with it the only copy of that Form.as file, it was in the include folder....
the problem is I don't remember were I got that script from.
If anyone knows of a form validation script that uses an external as file called Form.as
Please give me a link so I can check to see if it is the one I used. It is a MX script, AS 1
Thanks

Serialization File Lost
I have been using Flash MX for several years and all of a sudden I could not access it. An error message said "Serialization file not found DLL/Lib. What is going on here?

Any help appreciated.

Recovering A Lost File
I know there are tons of threads on the topic of re-creating an FLA from an SWF, but it isn't really clear what the best one is. Recently, while upgrading computers, I lost a file that holds the contents for much of a website. I'm almost positive it's gone, and I have no way of recovering it but from the SWF itself.

Can anyone lead me to a product (maybe one that they have used before, or have heard works, Mac or PC) that will recover my file? The file is not encrypted (it was a beta) and is not password protected through Flash either.

Thanks a lot,
Sportzguy933

MAN This File Slows Down At Times
I've designed several flash files that run great on this computer, but crawl on another computer. Same ram, same connection speed, etc. I'm not so much bugged about the difference as I am bugged about the slowdown at all.

I thought the file had just enough going on to NOT slow down a regular computer... but I'm discovering a significant difference when looking at the files from home.

So HERE'S MY QUESTION:
IS IT POSSIBLE to have two animations going on at the same time without causing a slowdown? I know, I know, there's many undetermined variables at this point. So I'll give an example.

Say I design a movie with a spinning oval. It's purple and grey, and it tumbles downward. Now, I want the page to have several of these at once, at different speeds, so I've created three library items, oval1, 2, and 3. I put each one on a path so it'll follow in a specific line... so the three items go across the page at different speeds. Whew man they slow down mad-crazy on my home PC, but go fine on this one -- and I honestly believe that THIS computer is a slower computer.

Is there ANY way to help speed up these types of files?

External File Paths
Is there any way of detecting a folder name that a file is in with ActionScript?
Like: Folder1/Folder2/File.swf ... somehow knowing that File exists within Folder1 and/or Folder2?
I know there are ways and workarounds with PHP, XML, HTML, or txt files, but I would love to do it all with AS.

Thanks.

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