A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 42

Thread: dynamic slide show with white boxes showing up

  1. #1

    dynamic slide show with white boxes showing up

    I have been trying to build this application for a number of weeks now and have run into something that simply stumps me.

    I have a photo gallery that loads photos, an mp3 and (eventually) a txt file that will have captions, photo credits and transition times.

    Now when the first two pics load and transition, they have these weird white boxes covering the photos. When the transition between the photos is done, the white box goes away.

    i have no idea where these shapes are coming from. The mp3 is not set to stream, I can interchange the photos and the problem persists, I have tried changing the depths.

    THEY ARE GHOSTS IN THE MACHINE and are slowly driving me mad.

    please help.
    Attached Files Attached Files

  2. #2
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    Oh, heh heh, ignore the PM I just sent you, looks like you already posted.

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  3. #3
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    Oddly enough, I can't seem to download the .zip, it just opens up a browser page full of encryption . . . is that a problem on my end? hmmm could you email the .zip to me?

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  4. #4
    I think I need a lesson in event handlers.

    can someone please explain why this code doesn't cycle (like an onEnter event should)



    onClipEvent (load) {
    _global.trans = 1;
    this.onEnterFrame = function() {
    firstTransition = _root["pictrans"+trans];
    secondTransition = _root["pictrans"+(trans+1)]-.2;
    trace("firstTransition= "+firstTransition);
    trace("secondTransition= "+secondTransition);
    // Text Boxes
    if (stopped != true) {
    _root.myDurationText = mySound.duration/1000;
    _root.myPositionText = mySound.position/1000;
    }
    // 1
    if (mySound.position/1000>firstTransition && mySound.position/1000<=secondTransition) {
    //_root.picMovieMC.gotoAndStop(frame);
    trace(_root["pic"+trans]._alpha);
    _root["pic"+(trans-1)]["caption"+(trans-1)].removeTextField();
    this.onEnterFrame = function() {
    if (_root["pic"+trans]._alpha<=100) {
    _root["pic"+trans]._alpha += 5;
    _root["pic"+(trans-1)]._alpha -= 5;
    } else {
    _root["pic"+trans]["caption"+trans]._visible = true;
    _root["pic"+(trans-1)].removeMovieClip();
    }
    };
    trace("successfully changed trans");
    _global.trans++;
    }
    };
    }

    also, does anybody see white boxes over the first two images?
    Attached Files Attached Files

  5. #5
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    Hey man,

    Tell me what all the output is that shows up when I first run your movie.

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  6. #6
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    Never mind, I see it now. It's the traces you have, and it executes over and over. That means, to answer your last question, it is iterating.

    I get this output:
    Code:
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    making picboxes
    onload event for mc
    firstTransition= 0
    secondTransition= 9.8
    on enter for mc
    firstTransition= 0
    secondTransition= 9.8
    on enter for mc
    firstTransition= 0
    secondTransition= 9.8
    on enter for mc
    firstTransition= 0
    secondTransition= 9.8
    on enter for mc
    firstTransition= 0
    secondTransition= 9.8
    on enter for mc
    firstTransition= 0
    secondTransition= 9.8
    on enter for mc
    firstTransition= 0
    secondTransition= 9.8
    etc...
    Oh, if you use actionscript highlighting when you post code, your code is much easier to read.

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  7. #7
    that is what is confusing me. The transition check will iterate but the alpha transitions don't.

    Do you see white boxes on the first two images?
    Is the image shown at 5% opacity with no transitioning?
    Am I seeing what everyone else is seeing.

    I have been working on both a PC and Mac. Weird stuff.

    code:
    onClipEvent (load) {
    //trans is a variable to keep track of what transition is next
    _global.trans = 1;
    }
    onClipEvent (enterFrame) {
    this.onEnterFrame = function() {
    //takes transition info from main timeline
    firstTransition = _root["pictrans"+trans];
    secondTransition = _root["pictrans"+(trans+1)]-.2;
    //trace("firstTransition= "+firstTransition);
    //trace("secondTransition= "+secondTransition);
    // Text Boxes show progress of Sound Object
    if (stopped != true) {
    _root.myDurationText = mySound.duration/1000;
    _root.myPositionText = mySound.position/1000;
    // checks to see if playhead of sound object is at the transition
    if (mySound.position/1000>firstTransition && mySound.position/1000<=secondTransition) {
    trace("HEY! "+_root["pic"+trans]._alpha);
    _root["pic"+(trans-1)].caption.removeTextField();
    // makes images transition
    if (_root["pic"+trans]._alpha<=100) {
    _root["pic"+trans]._alpha += 5;
    _root["pic"+(trans-1)]._alpha -= 5;
    } else {
    //makes caption visible after new image is at 100%
    _root["pic"+trans].caption._visible = true;
    //remove image that has alpha of 0
    _root["pic"+(trans-1)].removeMovieClip();
    }
    trace("successfully changed trans");
    _global.trans++;
    }
    }
    };
    }


  8. #8
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    I don't see any images at all, maybe that's why I'm confused...

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  9. #9
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    Okay, explain your .fla to me, I'll the buttons and stuff, what they're supposed to do, etc. (I'm finally getting some time to sit down and take a close look at it)

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  10. #10
    the included file (twelve_6) has comment tags for virtually EVERY line. (like I said, this is driving me nuts)

    the one caveat is that you need to wait for the Duration text box to display a number before you press the "test" button when you play the swf. The sound is not set to stream and needs to load first.


    Problems Outstanding:

    1. Sometimes the sound object loads sometimes it doesnt (ie. Sometimes a number WON'T show up in the duration box.)

    2. White boxes appear in front of the first two images

    3. Images aren't transitioning. That code doesn't want to repeat. The images are displayed at 5% opacity and then stop.

    Thanks again!
    Attached Files Attached Files

  11. #11
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    Thanks for the comments, that helps a ton.

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  12. #12
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    What's going on with this line?
    code:

    secondTransition = _root["pictrans"+(trans+1)]-.2;

    what does the dash, dot, and two do?

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  13. #13
    it sets a space of 2/10ths of a second (from the end of the first transition to the beginning of the second) for the playhead to fall into (in case there is some skipping when I set it to streaming)
    to instigate the alpha transition between the two.

  14. #14
    ie. it parses the _root["pictrans"+(trans+1)] as a numeric and then subtracts the .2

  15. #15
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    Yeah, just saw that. I was thinking _root["pictrans"...] was a movieclip or something, so I didn't understand why you were subtracting a number from it. I think I need some caffeine.

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  16. #16
    are you seeing this abdormalities?

  17. #17
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    No, it seems to be working fine for me, except for the alpha thing, it stays at 5%. Here's the code that changes the alpha:
    code:

    if (_root["pic"+trans]._alpha <= 100) {
    _root["pic"+trans]._alpha += 5;
    _root["pic"+(trans-1)]._alpha -= 5;
    } else {
    //makes caption visible after new image is at 100%
    _root["pic"+trans].caption._visible = true;
    //remove image that has alpha of 0
    _root["pic"+(trans-1)].removeMovieClip();
    }


    But if you watch the tracing closely, you'll see that this line gets evaluated as true only once:
    code:

    if (((mySound.position/1000) > firstTransition) && ((mySound.position/1000) <= secondTransition)) { . . . }


    Since the first if-statement is inside (a child) this latter one (the parent), the parent only gets executed once, so the alpha values only change once. You of course want the child if statement to execute over and over again. So the trick is to either get the parent if statement to evaluate to true more often than once every transition, or put the child if statement outside the parent, as its own function, so it can execute on its own. I'm looking at your picMovieMC now to see if I can determine why the child if statement I mentioned only evaluates to true once.

    Here's the traces I'm using, it shows the numbers better:
    code:

    trace(mySound.position/1000 + " > " + firstTransition + " && " + mySound.position/1000 + " <= " + secondTransition);
    if (((mySound.position/1000) > firstTransition) && ((mySound.position/1000) <= secondTransition)) {
    trace("HEY! "+ trans);
    _root["pic"+(trans-1)].caption.removeTextField();
    // makes images transition
    trace("alpha: " + _root["pic"+trans]._alpha);
    if (_root["pic"+trans]._alpha <= 100) {
    _root["pic"+trans]._alpha += 5;
    _root["pic"+(trans-1)]._alpha -= 5;
    } else {
    //makes caption visible after new image is at 100%
    _root["pic"+trans].caption._visible = true;
    //remove image that has alpha of 0
    _root["pic"+(trans-1)].removeMovieClip();
    }
    trace("successfully changed trans");
    //look for next transition
    _global.trans++;
    }


    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  18. #18
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    My brain is really not working today, it's driving me crazy. Where does _root.i get defined?

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

  19. #19
    it is the variable in a 'for' statement on the first frame of the main timeline actionscript

  20. #20
    thinking is design retrotron's Avatar
    Join Date
    Apr 2003
    Location
    Utah
    Posts
    141
    Ah, I see. All variables declared inside the parentheses of a for loop -- e.g.
    code:

    for ( . . . variables here . . . ) {
    . . . but not here . . .
    } // end for loop


    -- are defined by default as local variables. That means they only exist inside the for loop. Since you're trying to access it outside the loop, it has no value. You can see this if you trace the "i" in your picMovieMC, you'll get "undefined". Try setting a global variable called "count" or something so that the variable will be accessible from any timeline. Of course, if you do that, be sure to use
    code:

    count++;


    to increment the variable.

    absconditus.com // experiments in actionscripted design

    "I really must get a thinner pencil. I ca'n't manage this one a bit: it writes all manner of things that I don't intend". // Alice, Through the Looking Glass

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center