FLVPlayback help

Using an FLVPlayback component that is calling an external video. Got it to pause and seek to 0 when I click to different frame and once I click back I got it to play the video normally FINALLY! Problem is a quarter of the way through the second video play it automatically jumps to next frame. Anyone know why? Hope this thread is much more clear and I can get a response. Here is the scrip ---- Please Help.
--Frame 1--
import fl.video.*;
button.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
    teaser.pause();
    teaser.seek(0);
    teaser.visible = false;
    gotoAndPlay(2);
stop();
--Frame 2---
button2.addEventListener(MouseEvent.CLICK, btn2Down);
function btn2Down(event:Event):void
    teaser.visible = true;
    teaser.play();
    gotoAndPlay(1);
stop();
*teaser being the FLVPlayback instance name.

kglad,
They are added to the stage manually not from script and have instance names. I think they are both on autoplay as well. But I figured out the problem but not understanding why it is a problem. I forgot to mention the testing of the second video flvplayback on frame 2 also has a script that is calling it to go to frame 1 when the video is done. So I'm testing if both will work. That seems to be the problem. Once I remove the VideoEvent script, the play works fine but why and how would I work in the VideoEvent so I can also call an action once the video ends? Here is the full script:
frame 1
import fl.video.*;
button.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
    myVid.pause();
    myVid.seek(0);
    myVid.visible = false;
    gotoAndPlay(2);
stop();
Frame 2--
button2.addEventListener (MouseEvent.CLICK, btn2Down);
function btn2Down(event:Event):void{
     gotoAndPlay(1);
     myVid.visible = true;
     myVid.play();
mb.addEventListener (VideoEvent.COMPLETE, mbFin);
function mbFin(event:Event):void{
     gotoAndPlay(1);
stop();

Similar Messages

  • Help with FLVPlayback (as3)

    Hi There,
    I hope someone can save me with this.
    I am currently working on a project (AS3), where I have 2 frames, with 2 videos (using the FLVPlayback component).
    and I want to switch from one video to the next video, however the catch is when i switch to the next video I want the new video to play at the previous video time.
    example:
    Video 1 plays,  10 sec later, you click a button to go and see the next video (in another frame) and that new Video starts 10 sec into it.
    This is the codes I been using so far:
    import fl.video.VideoEvent;
    import fl.video.MetadataEvent;
    video1.addEventListener(VideoEvent.PLAYHEAD_UPDATE, timer);
    function timer(e:VideoEvent):void {
        var newTime = video1.playheadTime;
    nextFrame_btn.addEventListener( MouseEvent.MOUSE_UP, nextFrame);
    function nextFrame (MouseEvent):void
                gotoAndStop(2);
          video2.playheadTime = newTime;
    This doesn't work and I do not know what I am doing wrong.
    many thanks if you can help.

    Hi thanks for your reply.
    Ok I change the names of the button, etc to stop conflicts.. so this is the code:
    import fl.video.VideoEvent;
    import fl.video.MetadataEvent;
    var newTime:int;
    video1.addEventListener(VideoEvent.PLAYHEAD_UPDATE, counterX);
    function counterX(e:VideoEvent):void {
        newTime = video1.playheadTime;
    switch1_btn.addEventListener( MouseEvent.MOUSE_UP, switch1);
    function switch1 (MouseEvent):void
          gotoAndStop(2);
          vid1.playheadTime = newTime;
    It kind of works.. but I get these errors:
    The video player is in the connection error state. It enters this state when a video stream attempted to load but was unsuccessful. There are two possible reasons for the error: no connection to the server or the stream was not found.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at brid_fla::MainTimeline/counterX()
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at fl.video::FLVPlayback/http://www.adobe.com/2007/flash/flvplayback/internal::handleVideoEvent()
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::doUpdateTime()
              at flash.utils::Timer/_timerDispatch()
              at flash.utils::Timer/tick()

  • FLVplayback component mod help (Flash CS3, as3)

    can anyone help me with the actionscript needed to
    dynamically call a flv video into cs3's default
    flvplaybackcomponent with a variable?
    i have it working on as2 but the scripting must be different
    in as3 cause it dosnt work there.
    my as2 code is as follows:
    stop();
    var passed:String = video;
    player.contentPath= video;
    this allows me to use videoplayer.swf?video=[video].flv
    but i need this to work in cs3 flash9 player with the
    fullscreen support
    any help would be greatly appreciated.

    which version of flash cs3 do you have?

  • Error When Placing FLVPlayback Object on scene other then scene 1 Please Help

    When I place a FLVPlayback Object on scene 3 I get the following error
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at Untitled_fla::MainTimeline/__setProp_flv_promo1_Scene3_Layer1_0()
    at Untitled_fla::MainTimeline/frame1()
    Any suggestions would be greatly appreciated.
    Thanks

    you must have something trying to reference that component in frame 1.
    click file/publish settings/flash and tick "permit debugging" to get more detailed information, including the line number, about the code causing the error.

  • A better way to determine the current state of the FLVPlayback component?

    Below is the AS3 code I have used to display images (MCs) over an instance of the FLVPlayback component.  These images (one for loading, one for the title) are to appear – or disappear – according to the current state of the FLVPlayback component. 
    It “works,” but when testing, I have noticed that it can be rather finicky.  The most common issue that arises is that many times the loadPoster movieclip will still be visible even though the video has entered the playing state.
    Also, I wanted a title placeholder image to appear whenever the user stops the video or if the video completes.  However, I had to add the conditional statement to the “stoppedStateEntered” case to make everything appear when expected.  When the video is first viewed (and has completed buffering), it seems that the FLVPlayback component enters the stopped state before entering the playing state.  Thus, the titlePoster would flash on the screen right before it and the loadPoster “should” disappear when the video begins playing.
    Even in my limited testing, these issues were very easily re-created.  I am definitely looking for a more reliable solution.  Is there a better (or more correct) way to go about all this?  If possible, I would like to stick with the FLVPlayback component, just for the simple fact of not having to code my own.
    Where am I going wrong?
    function updateMoviePoster(event:VideoEvent):void
                    switch (event.type)
                                    case "playingStateEntered":
                                                    loadPoster.visible = false;
                                                    titlePoster.visible = false;
                                    break;
                                    case "stoppedStateEntered":
                                                    if (loadPoster.visible == false)
                                                                    titlePoster.visible = true;
                                    break;
                                    case "complete":
                                                    titlePoster.visible = true;
                                    break;
    myFLVPlayback.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, updateMoviePoster);
    myFLVPlayback.addEventListener(VideoEvent.STOPPED_STATE_ENTERED, updateMoviePoster);
    myFLVPlayback.addEventListener(VideoEvent.COMPLETE, updateMoviePoster);

    Any suggestions?  I would truly appreciate the help.

  • Flash video does not show up once uploaded. Help please.

    OK I've spent several days searching online for an answer to this question and I'm at my wit's end.  Please help me out.  This is what is going on.
    I'm using flash to design a basic website.  Within that website I want to place a .flv file.  Everything works fine in preview mode and test movie mode.  The problem comes when I puplish to the web.  I'm just using flash to publish which puts all the files in a folder.
    IN previous attempts, once I load those files onto a server it does not play the .flv file.  The .sfw skin will show up but the general .sfw file for the project doesn't seem to be finding the .flv file.  And yes, I'm uploading the .flv file to the server.  Is there something wrong with the html code that it can't find the .flv file?  I can replicate this problem on my desktop by moving the .flv file out of it's project folder.  Once I do that and then click the .html file the page will load but it won't find the video file.  It's like it can only open that file if it's in the original project folder and the folder doesn't get moved.
    I can't be the only who has experienced this.  Please help!

    The effect you're having "only displaying the flvplayer skin but no video" is a clear sign that your swf can't find the flv.
    One thing that you can do to ensure that everything is right is to first upload the .flv file to the desired location and then link your FLVPlayback to the url on the flash IDE / AS.
    2nd Option would be to:
    save flv, fla and swf in the SAME folder (no subfolders or such)
    upload flv and swf to your webserver while keeping them together in the same folder, that ensures that your files can find eachother.

  • Stuttering flv playback issue- need help asap

    We need help asap. Have a project is due to deliver today (5/14).
    We have a video to go on a dvd-rom, live action with Motion Graphics behind.
    When output is done thru Projector the Motion Graphics stutter as they scroll.
    Here is more technical info:
    Stuttering flv playback issue:
    Prores 422 timeline 29.97fps 1280x720 output from fcp using current settings.
    Mov file is approx 7gb, plays relatively smooth on a mac pro with no raid.
    Frame by frame analysis shows all frames are present with no jumps tears or skips.
    Tried several output paths, programs and settings to create a smooth flv file to no avail.
    We adjusted data rates from 2k, 3.5k, 4k and 8k, no luck
    We adjusted keyframe rates from low to all frames, no luck.
    We tried cs3 flash encoder, cs5 media encoder, squeeze ect, same results.
    Playback in the flash projector seems to choke slightly no matter what we do.
    Have also posted in the Director Forum.
    Any help much appreciated!

    Here are a few ideas off the top of my head:
    Try playing the file using a different xtra, sometimes different ones will work better.  If you have Director 11.5, there is a native flv playback xtra.
    You can build a player easily in Flash using the flvPlayback component, then bring that into Director as a swf.
    Once you have the video in Director, try making the member Direct To Stage (DTS).  If it is already DTS, try making it not DTS.
    Make sure the video is not transparent, and nothing in Director overlaps the video... in fact, when the video is playing, nothing should be moving at all, and try to keep the amount of code that is running to a minimum.
    Try lowering your video's data rate further or try using a different codec.
    Using VBR (Variable Bit Rate) compression often makes the video appear to play smoother.
    Try compressing the flv with different software.  FFMpeg, for example, is free and does a very good job, often better than the Flash Video Encoder that comes with Flash/Creative Suite.

  • CS5.5 AS3 FLVPlayback issue adding to stage or library

    I am unable to add the Action Script 3 FLVPlayback component to my stage or library in Flash CS5.5 when working with an action script 3 document.
    Under components in the video folder i click and drag anyone of the FLVPlayback components (FLVPlayback, FLVPlayback 2.5 or FLVPlaybackCaptioning) to the stage and nothing happens. I am unable to add it to my library as well. All the other actionscript 3 components under the Video folder work. (BackButton, BufferingBar, CaptionButton, etc...)
    If I create an actionscript 2 document the FLVPlayback component drags to the stage and adds to the library just fine. So this appears to be an actionscript 3 issue only.
    I have 2 other employees in my office using the same product and none of them have this issue. Only me.
    I have tried to uninstall the product and reinstall but nothing helps.
    I have Flash CS3 installed on my PC and the product has the same symptoms as the Flash CS5.5 trial version that I am running.
    I did not try this with Flash CS3 before I installed the CS5 trial. So I do not know if it worked prior to my CS5 evaluation.

    Microsoft Windows XP
    Professional
    Service Pack 3
    Video component
    Date Created: 3/17/2011
    Date Modified: 3/17/2011
    User folder
    Not sure what you are asking for here.
    Thanks for your assistance,
    Message was edited by: jimder

  • Help installing fms on windows server 2008

    Hello,
    I have FMS for developper 3.5.4. I have 2 computers:
    One called SVR with windows 2008 on it with iis7.
    One called PC with windows 7 which is my client.
    I would install FMS on the one called SVR beside IIS7.
    What I have done:
    I install FMS without apache.
    I create a flash file with an flvplayback object which have source property set to "rtmp://SVR/vod/sample.flv"
    This swf file is in a html file called test.html
    When I try to load this test.html I see the flvplayback object which seems seraching. But nothing happened from SVR or PC.
    Is it a problem with FMS, with firewall (I open 80,1935 ports).
    Thanks to any help or clue !
    N. Bauland

    Hi AbhishekSinha,
    1) In taskmanager, I have FMSCore (2 instances - is that normal ?), FMSMaster FMSEdge and FMSAdmin.
    2) I've tried following address:
    FROM SVR:
    address
    Result
    rtmp://localhost/vod/sample.flv
    OK
    rtmp://localhost:1935/vod/sample.flv
    OK
    rtmp://svr/vod/sample.flv
    OK
    rtmp://svr:1935/vod/sample.flv
    OK
    rtmp://lan-ip-of-svr/vod/sample.flv
    OK
    rtmp://lan-ip-of-svr:1935/vod/sample.flv
    OK
    rtmp://wan-ip-of-svr/vod/sample.flv
    OK
    rtmp://wan-ip-of-svr:1935/vod/sample.flv
    OK
    rtmp://public-internet-address/vod/sample.flv
    OK
    rtmp://public-internet-address:1935/vod/sample.flv
    OK
    FROM PC:
    address
    Result
    rtmp://localhost/vod/sample.flv
    FAILED(normal result)
    rtmp://localhost:1935/vod/sample.flv
    FAILED (normal result)
    rtmp://svr/vod/sample.flv
    FAILED ????
    rtmp://svr:1935/vod/sample.flv
    FAILED ????
    rtmp://lan-ip-of-svr/vod/sample.flv
    OK
    rtmp://lan-ip-of-svr:1935/vod/sample.flv
    OK
    rtmp://wan-ip-of-svr/vod/sample.flv
    OK
    rtmp://wan-ip-of-svr:1935/vod/sample.flv
    OK
    rtmp://public-internet-address/vod/sample.flv
    OK
    rtmp://public-internet-address:1935/vod/sample.flv
    OK
    As I've tried all previous time with rtmp://svr/... it has failed. But why can't I get rtmp://svr/... address ? http://svr/... for html page works fine.
    http://forums.adobe.com/people/AbhishekSinha

  • Need very urgent help

    Hi every1,
    i am in a very bad situation as i am very new to AS3, so i
    need some help from any one who can help me out of this.
    I have created a FLV Player using FLVPlayback Component
    everything is working fine but the only problem is the rewind and
    forward button behaves very strange when i test it on web page
    residing in a webserver.
    In brief i want to say that the rewind and forward control in
    the application works alright when i play it in my local machine
    but when i take the file to a web sever and play it the controls
    behave very strange (when i click on the forward and rewind button
    it just takes me to the end of the movie and to the start of the
    movie at one shot which should not be the purpose of the rewind and
    forward button).
    So, somebody please look at my code below and i will be very
    thank full to the person who can send me the correct code.
    The code for the rewind and forward control is higlighted in
    the below code. please help... .very urgent..........
    import fl.video.*;
    var flvSou:String;
    var dynText:String;
    myflv.autoPlay = true;
    onscreen_play_btn.visible = false;
    onscreen_replay_btn.visible = false;
    if (myflv.playing) {
    onscreen_play_btn.visible = false;
    onscreen_replay_btn.visible = false;
    //myflv.source = "Call_to_action.flv";
    myflv.source = root.loaderInfo.parameters.flvSou;
    dynTxt.text = String(root.loaderInfo.parameters.dynText);
    slash_txt.text = "/";
    myflv.playPauseButton = playPause_btn;
    myflv.stopButton = stop_btn;
    myflv.muteButton = mute_btn;
    myflv.volumeBar = volume_bar;
    myflv.volume = .6;
    myflv.forwardButton = forward_btn;
    myflv.backButton = back_btn;
    myflv.seekBar = seek_bar;
    myflv.bufferingBar = buffering_bar;
    myflv.fullScreenButton = fullscreen_btn;
    //========================= Actions for Button Controls
    =========================//
    //========================= Actions for Play and Pause Button
    =========================//
    playPause_btn.pause_mc.addEventListener(MouseEvent.CLICK,
    clickHandlerPause);
    function clickHandlerPause(event:MouseEvent):void {
    //trace("clickHandler detected an event of type: " +
    event.type);
    //trace("the event occurred on: " + event.target.name);
    trace("u clicked pause button");
    onscreen_play_btn.visible = true;
    //myflv.alpha = .5; // uncomment later
    playPause_btn.play_mc.addEventListener(MouseEvent.CLICK,
    clickHandlerPlay);
    function clickHandlerPlay(event:MouseEvent):void {
    //trace("clickHandler detected an event of type: " +
    event.type);
    //trace("the event occurred on: " + event.target.name);
    trace("u clicked play button");
    onscreen_play_btn.visible = false;
    //myflv.alpha = 100; // uncomment later
    if (onscreen_replay_btn.visible==true) {
    onscreen_replay_btn.visible=false;
    //========================= Actions for Play and Pause Button
    =========================//
    //========================= Actions for FLVPlayback
    =========================//
    myflv.addEventListener(MouseEvent.CLICK,
    clickHandlerPauseFlv);
    function clickHandlerPauseFlv(event:MouseEvent):void {
    //trace("clickHandler detected an event of type: " +
    event.type);
    //trace("the event occurred on: " + event.target.name);
    trace("u clicked video component button");
    trace(myflv.totalTime);
    if (myflv.playing==true) {
    myflv.pause();
    onscreen_play_btn.visible = true;
    //myflv.alpha = .5; // uncomment later
    } else {
    myflv.play();
    onscreen_play_btn.visible = false;
    onscreen_replay_btn.visible = false;
    //myflv.alpha = 100; // uncomment later
    //========================= Actions for FLVPlayback
    =========================//
    //========================= Actions for Fullscreen Button
    =========================//
    fullscreen_btn.addEventListener(MouseEvent.CLICK,onFullScreenButtonClick);
    function onFullScreenButtonClick(event:MouseEvent):void {
    stage.displayState = StageDisplayState.FULL_SCREEN;
    //or set it to normal like: stage.displayState =
    StageDisplayState.NORMAL;
    //========================= Actions for Fullscreen Button
    =========================//
    //========================= Actions for onScreenPlay Button
    =========================//
    onscreen_play_btn.addEventListener(MouseEvent.CLICK,onScreenPlayButtonClick);
    function onScreenPlayButtonClick(event:MouseEvent):void {
    trace("working");
    if (myflv.playing==true) {
    myflv.pause();
    } else {
    myflv.play();
    //myflv.alpha = 100; // uncomment later
    onscreen_play_btn.visible = false;
    //========================= Actions for onScreenPlay Button
    =========================//
    //========================= Actions for onScreenReplay Button
    =========================//
    onscreen_replay_btn.addEventListener(MouseEvent.CLICK,onScreenReplayButtonClick);
    function onScreenReplayButtonClick(event:MouseEvent):void {
    trace("working");
    myflv.play();
    //myflv.seek(0);
    onscreen_replay_btn.visible = false;
    if (onscreen_play_btn.visible==true) {
    onscreen_play_btn.visible=false;
    //========================= Actions for onScreenReplay Button
    =========================//
    //========================= Actions for Stop Button
    =========================//
    stop_btn.addEventListener(MouseEvent.CLICK, StopButtonClick);
    function StopButtonClick(event:MouseEvent):void {
    myflv.seek(0);
    //myflv.autoRewind = true;
    //myflv.stop();
    onscreen_replay_btn.visible = true;
    //========================= Actions for Stop Button
    =========================//
    //========================= Actions for Button Controls
    =========================//
    //========================= Actions for Displaying Elapsed
    and Total Time =========================//
    myflv.addEventListener(MetadataEvent.METADATA_RECEIVED,
    cp_listener);
    function cp_listener(eventObject:MetadataEvent):void {
    //trace("Elapsed time in seconds: " + myflv.playheadTime);
    //trace("Total time is: " + eventObject.info.duration);
    var rounded:int = Math.round(eventObject.info.duration);
    var minutes:int = Math.floor(rounded/60);
    var seconds:int = rounded%60;
    flvTotalTime_txt.text = eventObject.info.duration;
    flvTotalTime_txt.text = (minutes<10 ? "0" :
    "")+minutes+":"+(seconds<10 ? "0" : "")+seconds;
    //flvElapsedTime_txt.text = String(myflv.playheadTime);
    stage.addEventListener(Event.ENTER_FRAME, updateTime);
    function updateTime(ev:Event):void {
    var rounded:int = Math.round(myflv.playheadTime);
    var minutes:int = Math.floor(rounded/60);
    var seconds:int = rounded%60;
    flvElapsedTime_txt.text = String(myflv.playheadTime);
    flvElapsedTime_txt.text = (minutes<10 ? "0" :
    "")+minutes+":"+(seconds<10 ? "0" : "")+seconds;
    //========================= Actions for Displaying Elapsed
    and Total Time =========================//
    myflv.addEventListener(Event.COMPLETE, com_listener);
    function com_listener(eventObject:Event):void {
    trace("movie complete");
    myflv.stop();
    onscreen_replay_btn.visible = true;
    back_btn.addEventListener(MouseEvent.CLICK, BackButtonClick);
    function BackButtonClick(event:MouseEvent):void {
    myflv.play();
    //myflv.autoRewind = true;
    //myflv.stop();
    onscreen_replay_btn.visible = false;
    /************************************ THE CODE FOR FORWARD
    AND REWIND CONTROL STARTS HERE *****************************/
    var id1:Number;
    forward_btn.addEventListener(MouseEvent.MOUSE_DOWN,
    ForwardButtonDown);
    function ForwardButtonDown(event:MouseEvent):void {
    //forward_btn.onPress = function() {
    //mklik_flv.pause();
    var dest1:Number = myflv.playheadTime;
    id1 = setInterval(function ():void {
    myflv.seek(dest1 += 2);
    }, 100);
    forward_btn.addEventListener(MouseEvent.MOUSE_UP,
    ForwardButtonUp);
    function ForwardButtonUp(event:MouseEvent):void {
    //forward_btn.onRelease = function() {
    //myflv.play();
    clearInterval(id1);
    // ************************ Forward Button Function
    // ************************ Rewind Button Function
    var id2:Number;
    back_btn.addEventListener(MouseEvent.MOUSE_DOWN,
    BackButtonDown);
    function BackButtonDown(event:MouseEvent):void {
    //back_btn.onPress = function() {
    //mklik_flv.pause();
    var dest2:Number = myflv.playheadTime;
    id2 = setInterval(function ():void {
    myflv.seek(dest2 -= 2);
    }, 100);
    back_btn.addEventListener(MouseEvent.MOUSE_UP, BackButtonUp);
    function BackButtonUp(event:MouseEvent) {
    //back_btn.onRelease = function() {
    //mklik_flv.play();
    clearInterval(id2);
    }

    how long is your flv (in seconds), if allowed to play without
    ff/rewind/pause?

  • Publish settings Export frame set to 2 kills flvPlayback

    To let my tiny preloader show up before its at 75% I changed
    the export frame for classes to 2 in the publish settings. This
    works for the preloader but now the flvPlayback doesnt work.
    (except it does still work if I hit control enter a second time and
    watch my preloder work.Bizzare!) The .flw file still wont playback
    the .flv's when run on its own. Changing the export frame back to
    "1" and all is fine except the preloader is a no show till it's at
    75% or so.
    Dosent seem to be any way to change properties for the
    playback component itself.
    help please. The last thread I saw on this subject had no
    resolution and was from 2005.
    ff

    wow, you waited a whole of 10 minutes to complain you're not
    getting help?
    You might want to rethink that strategy, or you'll likely not
    get any help
    at all.
    Things export in the frame their in, unless you specify
    otherwise.
    A more proper way to make a preloader is to use a separate
    movie, and load
    the content into an empty movie clip. Then you can use
    MovieClipLoader, and
    accurately monitor and display the dl.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Loading content from XML help needed, please.

    Hey All,
    So here's my deal- I have a custom-built FLV Playback
    component (with captions) and need to load the following items from
    an XML file named "xml_doc.xml":
    <?xml version="1.0" encoding="UTF-8"?>
    <playlist id="Here's The Video" >
    <vid desc="Introduction to Biological Terrorism Agents"
    src="Intro.flv"
    thumb="Intro.jpg"
    caption="Intro.xml"
    </playlist>
    On the stage, here's what things are named:
    -my FLVPlayback Component is named myVideo
    -my thumbnail/preview image (empty movie clip) is named
    myPoster
    -my FLVPlaybackCaptioning Component is named captioning
    So how do I get these things to all get read from the XML
    document? It's easy to do it all through the FLA and hard-code the
    paths, but I can't seem to figure out how to pull from the external
    XML doc.
    Any help would be greatly appreciated.
    Joe

    You'll need to instantiate a few classes to help with this.
    The first is URLRequest:
    --var myXMLRequest:URLRequest = new
    URLRequest("xml_doc.xml");
    The URLRequest gets loaded by a URLLoader:
    --var myXMLLoader:URLLoader = new URLLoader();
    Then use the .load() method of the URLLoader:
    --myXMLLoader.load(myXMLRequest)
    Then add an event listener to your URLLoader
    --myXMLLoader.addEventListener(Event.COMPLETE, dataLoaded);
    Finally create the function to work with your data
    --function dataLoaded(e:Event):void {
    --var myXML:XML = new XML(e.target.data);
    --trace(myXML);
    Looks like:
    --var myXMLRequest:URLRequest = new
    URLRequest("xml_doc.xml");
    --var myXMLLoader:URLLoader = new URLLoader();
    --myXMLLoader.load(myXMLRequest)
    --myXMLLoader.addEventListener(Event.COMPLETE, dataLoaded);
    --function dataLoaded(e:Event):void {
    --var myXML:XML = new XML(e.target.data);
    --trace(myXML);
    (remove dashses, they're for readability)

  • FLVPlayback source with query strings (parameters) doesn't load

    Flash version: CS4
    AS version: AS3
    I'm currently trying to use the FLVPlayback component and pass a source FLV that's living on a cloudfront webserver. The problem is that the cloudfront requires authentication in the form of query strings in the source FLV. For example:
    import fl.video.*;
    var mainMovie:FLVPlayback = new FLVPlayback();
    mainMovie.source = "http://www.somedomainname.com/firmware.flv?dummyquery=22";
    trace(addChild(mainMovie));
    As soon as I take away the "dummyquery", it works fine. When I add a query string, it breaks (nothing loads).
    Here is the error output I get:
    [object FLVPlayback]
    VideoError: 1005: Invalid xml: URL: "http://www.somedomainname.com/firmware.flv?dummyquery=22&FLVPlaybackVersion=2.1" No root node found; if url is for an flv it must have .flv extension and take no parameters
         at fl.video::SMILManager/http://www.adobe.com/2007/flash/flvplayback/internal::xmlLoadEventHandler()
         at flash.events::EventDispatcher/dispatchEventFunction()
         at flash.events::EventDispatcher/dispatchEvent()
         at flash.net::URLLoader/onComplete()
    It adds on "&FLVPlaybackVersion=2.1" to the end.
    I saw a different article that said I should add a dummy variable at the end like "&dummy=.flv" because I was told that Flash is basically looking for an .flv extension at the end and you can trick it, but it doesn't work because they add on additional code.
    Does anyone know how to work around this?

    Hey supervu,
    I know you already found a workaround to make this work, just figured I'd post an alternative to editing the FLVPlayback compoent. I also am retrieving an FLV file via a .Net ASHX file. To keep both worlds happy, I used a URLRewriter module to translate for me... this one translates what I am using for the FLVPlayback component source:
    http://domain.com/flv/22.flv  to be resolved as http://domain.com/API/resource.ashx?ID=22
    There is of course no flv folder in the root of my application...
    Here is my very simple URLRewriter class in vb.net:
    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Web
    Public Class URLRewriter
        Implements IHttpModule
        Public Sub Init(ByVal inst As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
            AddHandler inst.BeginRequest, AddressOf Me.OnBeginRequest
        End Sub
        Public Sub OnBeginRequest(ByVal app As Object, ByVal e As EventArgs)
            Dim inst As HttpApplication = CType(app, HttpApplication)
            Dim req_path As String = inst.Context.Request.Path
            Dim trans_path As String = ""
            Dim search As String = "/flv/"
            Dim pos As Integer = req_path.IndexOf("/flv/")
            If pos > -1 Then
                Dim key as string = req_path.Substring(pos + search.Length, (req_path.LastIndexOf(".flv") - (pos + search.Length)))
                HttpContext.Current.Response.Redirect("~/API/resource.ashx?ID=" & key )
            End If
        End Sub
        Public Sub Dispose() Implements System.Web.IHttpModule.Dispose
        End Sub
    End Class
    and make sure you add this to your web.config.. this will cause URLRewriter to intercept all HTTP requests, and redirect as needed.
    <system.web>
         <httpModules>    
              <add name="URLRewriter" type="[Namespace].URLRewriter"/>
          </httpModules>
    </system.web>
    Hope this helps someone.

  • Is it possible to import YouTube videos into a flash FLVPlayback component...?

    Hi all,
    I'm now working on a flash website, i need to play a youtube video inside my flash movie.
    In this Flash file i have a FLVPlayback component and i tried to link the youtube video into this but did'nt work.
    Please help me...

    You should find what you need here: http://code.google.com/apis/youtube/flash_api_reference.html

  • Flash Video Player Need Help

    Hello everyone I am hoping someone here can help me.  I am going to school and I have an action scripting class.  For my final project we have to make a flash video player with a custom skin to upload to our websites. We did something similar to this with our first project which we made a player where the movies where embedded in the file itself but this is supposed to be a youtube like flash player where we can call in the files from another source.   
      We kind of got pressed for time and were not able to go into detail with this project so the teacher gave us the code and I put it in exactly how it should be but im pretty sure i have something misplaced or I am missing a step. I get 8 different errors when I go to test the movie. and nothing works.  Can someone please tell me what I am doing wrong or can you point me in the direction of a tutorial on this  as I have been searching for tutorials on this with no luck. 
    Here is my Action Script 3.0 CODE:
    import fl.video.FLVPlayback;
    import fl.controls.List;
    var vid:FLVPlayback = new FLVPlayback();
    vid.source= "fashion.flv";
    addChild(vid);
    vid.skin="SkinOverPlayStopSeekMuteVol.swf";
    vid.x=100;
    vid.y=300;
    vid.skinAutoHide="true";
    vid.width=500;
    vid.height=280;
    var vidList:List = new List();
    vidList.x= vid.x+10;
    vidList.y= 200;
    vidList.width=200;
    vidList.height=100;
    vidList.addItem({label:"Bathroom Behavior",data: "bathroom.flv"});
    vidList.addItem({label:"Chase Scene",data: "chase.flv"});
    vidList.addItem({label:"VMCAD Fashion Design Commercial",data: "fashion.flv"});
    addChild(vidList);
    vidList.addEventListener(Event.CHANGE,playVid);
    function playVid(e:Event):void{     
    vid.source=e.target.selectedItem.data;
    Here is a screenshot of the errors I am receiving.
    Please help me 
    thanks
    Message was edited by: BTwardy

    I don't know if what you posted is all that is in that as file, but you need to declare a package, then call the import statements, then declare the class name.  Like this:
    package {
         import flash.display.Sprite;
         import flash.events.Event;
         import fl.video.FLVPlayback;
         import fl.controls.List;
         public class Main extends Sprite {
              public function Main() {
                   var vid:FLVPlayback = new FLVPlayback();
                   vid.source= "fashion.flv";
                   addChild(vid);
                   vid.skin="SkinOverPlayStopSeekMuteVol.swf";
                   vid.x=100;
                   vid.y=300;
                   vid.skinAutoHide="true";
                   vid.width=500;
                   vid.height=280;
                   var vidList:List = new List();
                   vidList.x= vid.x+10;
                   vidList.y= 200;
                   vidList.width=200;
                   vidList.height=100;
                   vidList.addItem({label:"Bathroom Behavior",data: "bathroom.flv"});
                   vidList.addItem({label:"Chase Scene",data: "chase.flv"});
                   vidList.addItem({label:"VMCAD Fashion Design Commercial",data: "fashion.flv"});
                   addChild(vidList);
                   vidList.addEventListener(Event.CHANGE,playVid);
              function playVid(e:Event):void{     
                   vid.source=e.target.selectedItem.data;
    Then click on your stage in Flash, then open the properties window, and fill the Class text field with:   Main
    Make sure the as file is saved in the same folder as the flv.

Maybe you are looking for