help needed with loading images into gallery site

  • ronnie dobbs
  • Born
  • Born
  • ronnie dobbs
  • Posts: 2

Post 3+ Months Ago

Hello,
I'm basically a novice with actionscript so what I've got here with my portfolio project has a lot of code that's copied from various places and modified to suit my purposes. So, here's the swf in question:
http://sbeelman.com/photography/index2.htm
I originally had all of the photos embedded (look at index.htm) but decided that I'd try to do it with dynamically loading the jpgs using loadMovie.
What I'd like is as the image movieclips load, the alpha value is set to the percentage loaded, so that they fade in. I should probably also add a progress bar of some kind for people with really slow connections.
The JPGs are placed into a movieclip which is inside another movieclip that's placed on the stage. I tried using a getbytesloaded script for determining if a certain image had loaded, but it became painfully obvious I didn't know what I was doing ;).
If anyone is willing to help me please let me know what code you would need to see in order to figure out what to do (I'm not sure which code I should paste here to help you help me)...

Thanks in advance.
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

the image isn't actually going to be there until it's 100% loaded, so to set the alpha level to the % loaded would be ineffective...

what you need to do is wait for the whole image to be loaded in and then fade it in... so you could set up a progress bar for it... then once it's loaded, do a fade in the same speed as your fade out...
  • ronnie dobbs
  • Born
  • Born
  • ronnie dobbs
  • Posts: 2

Post 3+ Months Ago

Wow, yeah, I feel stupid now. Of course it wouldn't be available to fade in until it's loaded! Brain lapse there, please forgive. :oops:
So I need a way to easily make all of the image movieclips a zero alpha, then once they're loaded, fade them in. What do I need to show, in the way of my current actionscript, that will help you or someone else to describe what I need to do?
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

well, i just need to know how you're loading it...

if, say, your script is:

Code: [ Select ]
loadMovie("blah.jpg","holder_mc");


then all you have to do is have a script that says:

Code: [ Select ]
holder_mc.onEnterFrame(){
if(this.getBytesLoaded==this.getBytesTotal){
setProperty(this,_alpha,"100");
}else{
setProperty(this,_alpha,"0");}
  1. holder_mc.onEnterFrame(){
  2. if(this.getBytesLoaded==this.getBytesTotal){
  3. setProperty(this,_alpha,"100");
  4. }else{
  5. setProperty(this,_alpha,"0");}


i'm pretty sure that's the right syntax... you can adjust it to whatever your needs are, too... you know, if you have some timeline effect going on or whatever... or if you want something else to happen once it fades in, you can add that, blah blah blah...

hope that helps

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 2 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.