Re: [Flashcoders] Loading images at the same time, bugs in Flash AS3

2009-06-03 Thread Anthony Pace
I would love to see what's going on, as it sounds crazy; yet, your site 
isn't coming up for me.



Isaac Alves wrote:

Hello fellowcoders,
I've been experiencing some problems with an application I've made with AS3.
It consists of an image gallery which loads images dynamically from an XML
file.

Maybe you'd want to skip my explanations and go directly to the problem in
the bottom of this message.

Since it's my first experience with AS3 - apart from doing some basic AS3
tutorials and other not so simple but still very simple stuff with AS2 a
couple of years ago - it is absolutely not written in the simplest and more
effective manner.

For example, I've changed the code lots of times. For example, redefining
the way the images were loaded. At the beginning they were loaded by
clicking on the thumbnails. So if I clicked on the thumb of an image that
were already loaded, it would load it again. Now it works like that:

There are 3 arrays of images (for the thumbnails, big thumbnails and full
images).
So these three sequences of images start loading at the same time, and
placing the images as elements in the arrays in order to be more easily
handled (to my point of view).
Naturally the thumbnails finish loading first. If I click on a thumbnail
whose corresponding image is not yet loaded, It starts loading it. And then
when the function that keeps running to load all the full images gets to it,
it skips it.

There are lots of other things I could have done better for example, placing
many of the elements inside of a movieclip, for example a bar which would
contain all the elements of the thumbnail mechanismus ( containers, masks,
buttons). I've tried that but it was maybe too late, for it was difficult
cause I had many references to those elements with in the code.

There's no document class, and 80% of the code is written in one frame.
Actually I don't know how I could write this whole thing using different
class files, for example, cause it would have many cross-references, etc.
But I would like to know how to do it!

So the main problems are the following:


   1. Sometimes (randomly) the array ot thumbnails stop loading. It gets
   stuck in a certain thumbnail, showing the preloader movieclip forever.
   2. Another problem is that the browser's window simply closes itself by
   clicking on an item in the menu, that happend in Safari and Firefox.
   3. Another problems occur with the menu (the icon moves up and not the
   square behind it, or the whole thing gets stuck.

Any help will be appreciated !

You can check it out on this link: http://iialves.com/hive/

I've probably put this version one week ago, so I've been unpdating it since
then. But it remais something very close to that.

Now I should go cause I'm late to work.
Thanks a lot!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Loading images at the same time, bugs in Flash AS3

2009-06-03 Thread Anthony Pace

Without looking through your code:

   * For alignment of the thumbnail container, you could be waiting
 until after everything has loaded inside before asking it to
 change it's y position.
   * For the thumbs not loading properly, that could be caused by your
 load order...  Your downloads are racing each other.  Things need
 to be loaded in sequence for stability; yet, you are, if I am not
 mistaken, downloading everything at once in a loop, not waiting
 until one thing downloads until you go to the next; yet, in your
 display, you are making it wait.  Flash lets you send multiple
 requests at once and does not automatically que your requests, in
 the sense that only one can happen at a time; therefore, if
 something needs to load in sequence, you need to put safeguards in
 your code to ensure that things get loaded in order of priority.

Just guessing,
Anthony

Anthony Pace wrote:
I would love to see what's going on, as it sounds crazy; yet, your 
site isn't coming up for me.



Isaac Alves wrote:

Hello fellowcoders,
I've been experiencing some problems with an application I've made 
with AS3.
It consists of an image gallery which loads images dynamically from 
an XML

file.

Maybe you'd want to skip my explanations and go directly to the 
problem in

the bottom of this message.

Since it's my first experience with AS3 - apart from doing some basic 
AS3

tutorials and other not so simple but still very simple stuff with AS2 a
couple of years ago - it is absolutely not written in the simplest 
and more

effective manner.

For example, I've changed the code lots of times. For example, 
redefining

the way the images were loaded. At the beginning they were loaded by
clicking on the thumbnails. So if I clicked on the thumb of an image 
that

were already loaded, it would load it again. Now it works like that:

There are 3 arrays of images (for the thumbnails, big thumbnails and 
full

images).
So these three sequences of images start loading at the same time, and
placing the images as elements in the arrays in order to be more 
easily

handled (to my point of view).
Naturally the thumbnails finish loading first. If I click on a thumbnail
whose corresponding image is not yet loaded, It starts loading it. 
And then
when the function that keeps running to load all the full images gets 
to it,

it skips it.

There are lots of other things I could have done better for example, 
placing
many of the elements inside of a movieclip, for example a bar which 
would
contain all the elements of the thumbnail mechanismus ( containers, 
masks,
buttons). I've tried that but it was maybe too late, for it was 
difficult

cause I had many references to those elements with in the code.

There's no document class, and 80% of the code is written in one frame.
Actually I don't know how I could write this whole thing using different
class files, for example, cause it would have many cross-references, 
etc.

But I would like to know how to do it!

So the main problems are the following:


   1. Sometimes (randomly) the array ot thumbnails stop loading. It gets
   stuck in a certain thumbnail, showing the preloader movieclip 
forever.
   2. Another problem is that the browser's window simply closes 
itself by

   clicking on an item in the menu, that happend in Safari and Firefox.
   3. Another problems occur with the menu (the icon moves up and not 
the

   square behind it, or the whole thing gets stuck.

Any help will be appreciated !

You can check it out on this link: http://iialves.com/hive/

I've probably put this version one week ago, so I've been unpdating 
it since

then. But it remais something very close to that.

Now I should go cause I'm late to work.
Thanks a lot!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Loading images at the same time, bugs in Flash AS3

2009-06-03 Thread Jordan L. Chilcott
My guess is that if it's iterating through a loop to load, I would 
imagine that the loader objects are being lost in the loop by getting 
de-referenced and are getting garbage collected. If this is what's 
happening, you would probably have to put your loader objects in a stack 
or array so they don't get de-referenced, and then do some housekeeping 
to remove them once they have been loaded.


jord

Anthony Pace wrote:

Without looking through your code:

   * For alignment of the thumbnail container, you could be waiting
 until after everything has loaded inside before asking it to
 change it's y position.
   * For the thumbs not loading properly, that could be caused by your
 load order...  Your downloads are racing each other.  Things need
 to be loaded in sequence for stability; yet, you are, if I am not
 mistaken, downloading everything at once in a loop, not waiting
 until one thing downloads until you go to the next; yet, in your
 display, you are making it wait.  Flash lets you send multiple
 requests at once and does not automatically que your requests, in
 the sense that only one can happen at a time; therefore, if
 something needs to load in sequence, you need to put safeguards in
 your code to ensure that things get loaded in order of priority.



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders