A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Embedded Video SWF won't play: corrupted?

  1. #1
    Member
    Join Date
    May 2002
    Location
    USA.me._x = 18; _y = 36;
    Posts
    79

    Embedded Video SWF won't play: corrupted?

    hi all. I have an embedded video SWF file, with a preloader, that plays fine on the hard drive, but no matter what I try it won't play on the server. The preloader loads to 100%, but won't engage the video.
    Here's the catch: the same files used to play fine, now they won't.
    So i strongly believe the problem does NOT lie with the preloader.
    What else might be wrong, besides the preloader?
    is the file corrupted somehow? Anyone have any experience with this?

    thanks for venturing a guess.
    fp
    <fp>

  2. #2
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    What is your preloader script?

  3. #3
    Member
    Join Date
    May 2002
    Location
    USA.me._x = 18; _y = 36;
    Posts
    79
    hi Wheels. I sure HOPE it's only a matter a faulty preloader script.
    that would fill me with hope. Here's the preload code.
    code:

    function preload(preloadContent){
    //turns on and initializes the preloader
    preloader._visible = 1;
    preloader.bar._yscale = 0;
    preloader.display.text = "0% loaded";
    //sets an interval to update the loading progress
    intervalId = setInterval(preloadCallback,10,preloadContent);
    }

    function preloadCallback(preloadContent){
    //initializes variables to track the loading progress
    var download = 0;
    var downloaded = 0;
    var percentLoaded = 0;

    //grabs the total and loaded bytes
    download = preloadContent.getBytesTotal();
    downloaded = preloadContent.getBytesLoaded();
    percentLoaded = Math.ceil(downloaded/download*100);

    //updates the preloader display
    preloader.display.text = percentLoaded + "% loaded";
    preloader.bar._yscale = percentLoaded;
    updateAfterEvent();

    //sees if it's finished
    if (downloaded == download && download > 0){
    preloadContent.gotoAndPlay(2);
    //deletes the interval and turns off the preloader
    clearInterval(intervalId);
    preloader._visible = 0;

    }
    }



    I also have a stop action on the first frame, where the function is called. There aren't any scenes. when it's loaded the playhead jumps
    to frame 2, the first frame of my video. the video is 778K.

    thanks for taking a look!
    fp
    <fp>

  4. #4
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    I would use an onEnterFrame instead of the setInterval - this may be the reason you are jumping to frame 2.

    I think this is the culprit:

    Code:
    percentLoaded = Math.ceil(downloaded/download*100);
    try Math.floor

  5. #5
    Member
    Join Date
    May 2002
    Location
    USA.me._x = 18; _y = 36;
    Posts
    79
    thanks, Wheels. I'll tinker around with it and show up when I have some results.
    fp
    <fp>

  6. #6
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    Here's a link to a solution I posted a few weeks ago.

    http://www.flashkit.com/board/showth...hreadid=548903

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