Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : movie stopping for some reason


Park Flasher
5/11/2004 8:48:54 PM
hello,
i have a movie which has 4 almost identical scenes, the only difference is the
txt file it loads, which contains the names of jpgs.

when i first go to the movie, it doesn't load the pics and stops before
displaying all the graphics and stuff on the page. if i hit a button to go to
another scene, or if i rightclick and hit 'play', it starts working fine.
when i return to this page from the others, it works fine too. if i hit
'reload' on the browser, it works. it's not working only upon the first load.

do i need an IF statement to check if the vars are loaded ? (and if so, how's
that done !?)

here's my first line of AS: (same on all scenes, except for the txt file)


Gallery = [];
listGallery = new LoadVars();
listGallery.load("listcdpackaging.txt");
listGallery.onLoad = function() {
Gallery = listGallery.gallery.split("|");
galleryAmount = Gallery.length;
choice = 0;
gotoAndPlay(2);
};
artist = title=label=credit="";
ta._visible = tt._visible=tl._visible=tc._visible=imageFrame._visible=false;
next._visible = false;
stop();



_______________
this code was suggested to me, but didn't do the trick, unfortunately:

// initialize all
Gallery = [];
artist = title = label = credit = "";
ta._visible = tt._visible = tl._visible = tc._visible = imageFrame._visible =
false;
next._visible = false;

// load data
listGallery = new LoadVars();
listGallery.tl = this;
listGallery.onLoad = function() {
this.tl.Gallery = this.gallery.split("|");
this.tl.galleryAmount = this.tl.Gallery.length;
this.tl.choice = 0;
this.tl.gotoAndPlay(2);
};
listGallery.load("listcdpackaging.txt");

// stop movie while loading
stop();



thanks a million for any help
Jack.
5/11/2004 9:34:29 PM
this might not work, but is worth a try :)
rather than repeating the code on each scene, make it a frame#1
function that accepts the text file name and a frame label as
parameters, the frame label will be on frame#2 in each scene,

function oneFunction(theTxt,theLabel){
Gallery = [];
listGallery = new LoadVars();
listGallery.load(theTxt);
listGallery.onLoad = function() {
Gallery = listGallery.gallery.split("|");
galleryAmount = Gallery.length;
_root.choice = 0;
_root.gotoAndPlay(theLabel);
};
};

initialize with -
oneFunction("listcdpackaging.txt","sc1fr2"); stop();
continue with
oneFunction("listdvdpackaging.txt","sc2fr2"); stop();

hth ??

privatenews.microsoft.com
5/12/2004 3:09:34 PM
Try this!





Gallery = [];
//load event checker//
listGallery = new LoadVars();
listGallery.load("listcdpackaging.txt");
//assign a function which fires when the data is loaded:
listGallery.onLoad = function(success) {
if (success) {
trace("loaded");
//Now that we know the data is loaded,
//we can progress
Gallery = listGallery.gallery.split("|");
galleryAmount = Gallery.length;
choice = 0;
gotoAndPlay(2);
} else {
trace("not loaded");
}
};
artist = title=label=credit="";
ta._visible = tt._visible=tl._visible=tc._visible=imageFrame._visible=false;
next._visible = false;
stop();



[quoted text, click to view]

Park Flasher
5/13/2004 11:45:25 PM
thanks a lot for posting that, i tried it out, but i'm afraid it didn't fix my
problem. here's the link to the movie -

http://65.36.161.225/eyecandy.cfm

when you go there, you will see the movie doesn't show the thumbnails, but if
you right-click-play or right-click-forward, it works ok, or [b]simply hit
'reload' and it works[/b], which is way wierd to me, and makes me think it's
something in the embed code. is that possible ? i used the standard
dreamweaver embed with autostart

privatenews.microsoft.com
5/14/2004 9:57:47 AM
could you make the fla available for download, Im sure it can be sorted


[quoted text, click to view]

Park Flasher
5/14/2004 6:59:15 PM
hey, thanks a LOT for your help on this.

i wouldn't feel right posting my client's movie online, but here's the rest of
the code, hope it helps. thanks a million for your time.

the embed is like this:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=6,0,0,0"
WIDTH="708" HEIGHT="390" id="Scroller4-27" ALIGN="">
<PARAM NAME=movie VALUE="Scroller4-27.swf"> <PARAM NAME=loop VALUE=false>
<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED
src="Scroller4-27.swf" loop=false quality=high bgcolor=#FFFFFF WIDTH="708"
HEIGHT="390" NAME="Scroller4-27" ALIGN=""
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>


1st frame, layer 1:

function showNode(z, deep) {
if (!z.hasChildNodes) {
if (z.nextSibling != null) {
showNode(z.nextSibling, deep);
}
} else {
for (var name in z.attributes) {
if (name == "artist") {
datum.artist[NN] = z.attributes[name];
} else if (name == "title") {
datum.title[NN] = z.attributes[name];
} else if (name == "label") {
datum.label[NN] = z.attributes[name];
} else if (name == "credit") {
datum.credit[NN] = z.attributes[name];
} else if (name == "image") {
datum.image[NN] = z.attributes[name];
}
}
showNode(z.firstChild, deep+1);
if (z.nextSibling != null) {
if (z.nextSibling.nodeName == "disk") {
NN++;
} else if (z.nextSibling.nodeName == "gallery") {
curPath = z.nextSibling.attributes["path"];
}
showNode(z.nextSibling, deep);
}
}
}





1st frame, second layer:


Gallery = [];
//load event checker//
listGallery = new LoadVars();
listGallery.load("listcdpackaging.txt");
//assign a function which fires when the data is loaded:
listGallery.onLoad = function(success) {
if (success) {
trace("loaded");
//Now that we know the data is loaded,
//we can progress
Gallery = listGallery.gallery.split("|");
galleryAmount = Gallery.length;
choice = 0;
gotoAndPlay(2);
} else {
trace("not loaded");
}
};
artist = title=label=credit="";
ta._visible = tt._visible=tl._visible=tc._visible=imageFrame._visible=false;
next._visible = false;
stop();





privatenews.microsoft.com
5/17/2004 10:19:14 AM
can you upload the movie with debug allowed so that I can check the loading
of variables, and dynamic text?



[quoted text, click to view]
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#ve
[quoted text, click to view]

AddThis Social Bookmark Button