-
setting visibility based on the load
so i have some thumbnails for a gallery and im trying to make them only appear if the user has loaded a thumbnail for it. i will let the code speak...
if (_root.mainarea.six.galleries[thumbnail].blank.myBytes <= 100) {
_root.mainarea.six.galleries[thumbnail]._visible = true;
} else {
_root.mainarea.six.galleries[thumbnail]._visible = false;
}
}
i cant seem to get the operator or the measuring correct. is there some glaring error in the "<=" or something ?
-
Use 0 & 1 instead of True & False....
invisible:
_visible = 0;
visible:
_visible = 1;
-
FK'n_dog
Use 0 & 1 instead of True & False
this will not make any difference as the values are totally interchangable
F_M - what do you get from this trace -
trace(_root.mainarea.six.galleries[thumbnail].blank.myBytes);
-
-
a_m_d
it says "undefined"....hmm. a clue ?
-
FK'n_dog
do you get any output by tracing the result within an OEF loop
(code on main timeline, same frame as your path .. _root.mainarea....... )
this.onEnterFrame = function(){
trace(_root.mainarea.six.galleries[thumbnail].blank.myBytes);
};
-
so i put this as an OEF in the gallery section and instead of having the path include the result of a variable ([thumbnail]) i wrote it in so the path is:
this.onEnterFrame = function(){
trace(_root.mainarea.six.galleries.galleryone1.bla nk.myBytes);
};
and that just gives me another 'undefined' in the output.
i just made a test movie that just has a jpeg in a MC and put the same trace code on and it says 'undefined' as well:
this.onEnterFrame = function(){
trace(this.tester.myBytes);
};
-
FK'n_dog
where does myBytes come from ?
how are you setting this variable ?
try tester.getBytesLoaded()
have a read of the Help Files -
ActionScript 2.0 Language Reference
ActionScript classes > MovieClipLoader
This class lets you implement listener callbacks that provide status information while SWF, JPEG, GIF, and PNG files are being loaded into movie clips.
-
ok, thanks for your help with this AMD. i have got the trace thing working now but my test cant seem to distinguish between a thumbnail that has been loaded with a jpeg and one that hasnt now:
onClipEvent (load) {
initial = "galleryone";
thenumber = 1;
textnumber = 1;
thumbnail = initial + thenumber;
thumbimage = "thumb_" + thumbnail;
loadMovie("images/"+[thumbimage]+ ".jpg", _root.mainarea.six.galleries[thumbnail].blank)
_root.mainarea.six.galleries[thumbnail].blank.getBytesLoaded()
trace(_root.mainarea.six.galleries[thumbnail].blank.getBytesLoaded());
if (_root.mainarea.six.galleries[thumbnail].blank.bytesLoaded <= 100) {
_root.mainarea.six.galleries[thumbnail]._visible = false;
} else {
_root.mainarea.six.galleries[thumbnail]._visible = true;
}
}
-
FK'n_dog
if (_root.mainarea.six.galleries[thumbnail].blank.bytesLoaded <= 100) {
should be -
if (_root.mainarea.six.galleries[thumbnail].blank.getBytesLoaded() <= 100) {
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|