#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    76
    Rep Power
    7

    Question Please Help with Preloader


    I pulled this preloaded from http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00000421.html.

    For some reason it's not working as I thought it would.
    What's happening is that while preloading, you can hear the sound but no video.

    My video component is named, my_video.

    Code:
    var connection_nc:NetConnection = new NetConnection();
    connection_nc.connect(null);
    var stream_ns:NetStream = new NetStream(connection_nc);
    my_video.attachVideo(stream_ns);
    stream_ns.play("http://www.helpexamples.com/flash/video/lights_short.flv");
    
    this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10, 160, 22);
    var loaded_interval:Number = setInterval(checkBytesLoaded, 500, stream_ns);
    function checkBytesLoaded(my_ns:NetStream) {
        var pctLoaded:Number = Math.round(my_ns.bytesLoaded / my_ns.bytesTotal * 100);
        loaded_txt.text = Math.round(my_ns.bytesLoaded / 1000) + " of " + Math.round(my_ns.bytesTotal / 1000) + " KB loaded (" + pctLoaded + "%)";
        progressBar_mc.bar_mc._xscale = pctLoaded;
        if (pctLoaded >= 100) {
            clearInterval(loaded_interval);
        }
    }

    Please help

    Thank you
  2. #2
  3. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,675
    Rep Power
    3164
    Hi, you have to drag a copy of the video object to the stage and give it the instance name my_video. If you don't do those two things then you will only hear the video and see the TextField.
    Quis custodiet ipsos custodes?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    76
    Rep Power
    7
    Hi Tann San,

    I do have a video on the stage with the instance name of my_video.

    there's only 1 frame and both the video component and the as are in frame 1.

    Did you get this working yourself?


    Thanks
  6. #4
  7. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,675
    Rep Power
    3164
    Yes, I just created a new instance of the video in the library, copied an instance of it to the stage, gave it an instance name, set the dimensions and then copy and pasted the code you posted. Note that I used your code and not the code from the Adobe website. It just worked straight away. Then I deleted the video and tried it which is what I described before.

    Are you sure you are not getting any warnings or errors in the output box? Make sure that the video is set to be "ActionScript controlled" and not "Embedded". You can do that either when you first create the video or by double clicking it in the library to open its properties panel.
    Quis custodiet ipsos custodes?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    76
    Rep Power
    7
    I'm not getting any warning.
    under the properties of the flvplayback component, i don't see a setting about embedding as opposed to actionscript.
    the only thing i see is export for...

    unfortunately i'm still experiencing these symptoms.
    I'm still getting the preloader text showing on the top left hand corner and the sound of the flv but no video.

    mind you the the publish setting is set for flash player 10 and 2.0.
    do you have a fla of what you've done?

    thanks
  10. #6
  11. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,675
    Rep Power
    3164
    Hi, you don't drag a copy of the FLV Playback component to the stage. You go to your library and then click on the little green/grey icon in the top right. One of the options is "New Video". Choose that and it will create a Video object in the library, not an FLVPlayback component.
    Quis custodiet ipsos custodes?
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    76
    Rep Power
    7
    Ahh yes!
    I was under the impression that both of those components were the same.

    The video now plays.
    I spent hours this morning trying to get my seekBar component to work with the video and for the life of me can't figure it out.

    Thanks
  14. #8
  15. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,675
    Rep Power
    3164
    FLVPlayback control is actually easier to use. You just drop an instance of it on the stage and then enter the path to the external flv video in the "path" property via the component properties panel. The only thing to make sure of there is that you don't use an absolute path which is a common pitfall and usually ends up with people trying to load videos with a path to a local file, when online, by accident.
    Quis custodiet ipsos custodes?
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    76
    Rep Power
    7
    Thanks Tann

IMN logo majestic logo threadwatch logo seochat tools logo