dcsimg
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 39 of 39

Thread: CS4/AS3 - Can't Unload FLV Called to Timeline

  1. #21
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    oh i think i had the file name wrong -

    this should work: http://moronica.net/compton.zip

  2. #22
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    I'm using ffmpeg to convert your movie to an .flv is this acceptable?
    ~calmchess~

  3. #23
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    get file off my server.....I'm almost maxed out on my uploads here.

    http://privatechatnow.com/test_suite/compton.zip
    ~calmchess~

  4. #24
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    thanks a million - will now add the code to unload the .flv when navigating away from the "game" scene and see if it works...

    mark

  5. #25
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    still having the same problem.

    if i have this code: vid.attachNetStream(null); attached to the end of the code to play the video it won't play at all...

    here's what I now have:

    var vid:Video = new Video(480, 320);

    vid.x=231;
    vid.y=457;

    addChild(vid);

    var nc:NetConnection = new NetConnection();
    nc.connect(null);

    var ns:NetStream = new NetStream(nc);
    vid.attachNetStream(ns);

    var listener:Object = new Object();
    listener.onMetaData = function(evt:Object):void {};
    ns.client = listener;
    ns.play("compton.flv");
    vid.attachNetStream(null);

    bummin...

  6. #26
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    if i have this code: vid.attachNetStream(null); attached to the end of the code to play the video it won't play at all...


    //////////////////////////////////////
    /////////////////////////////////////
    This is good that means it killed the video now call vid.attachNetStream(null) on button press as a test to see if it kills the video in the middle of the movie
    ~calmchess~

  7. #27
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    tried to add it to the code which controls the buttons - in this case the music button but the .flv still plays.

    here's that code

    //handle events for buttons...
    home.addEventListener (MouseEvent.CLICK, clickHome) ;

    function clickHome (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
    trace ("the home button was clicked")

    //go to the section clicked on...
    gotoAndPlay ("home start");
    }



    info.addEventListener (MouseEvent.CLICK, clickInfo) ;

    function clickInfo (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
    trace ("the info button was clicked")
    //go to the section clicked on...

    gotoAndPlay ("info start");
    }



    music.addEventListener (MouseEvent.CLICK, clickMusic) ;
    function clickMusic (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
    vid.attachNetStream(null)
    trace ("the music button was clicked")
    //go to the section clicked on...
    gotoAndPlay ("music start");

    }



    game.addEventListener (MouseEvent.CLICK, clickGame) ;

    function clickGame (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
    trace ("the game button was clicked")
    //go to the section clicked on...
    gotoAndPlay ("game start");
    }



    comic.addEventListener (MouseEvent.CLICK, clickComic) ;

    function clickComic (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
    trace ("the comic button was clicked")
    //go to the section clicked on...
    gotoAndPlay ("comic start");
    }


    cartoon.addEventListener (MouseEvent.CLICK, clickCartoon) ;

    function clickCartoon (evtObj:MouseEvent) {
    //trace shows what's happening in the output window

    trace ("the cartoon button was clicked")
    //go to the section clicked on...
    gotoAndPlay ("cartoon start");
    }


    blog.addEventListener (MouseEvent.CLICK, clickBlog) ;

    function clickBlog (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
    trace ("the blog button was clicked")
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("http://blog.moronica.net");
    navigateToURL(request, "_blank");
    }


    store.addEventListener (MouseEvent.CLICK, clickStore) ;

    function clickStore (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
    trace ("the store button was clicked")
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("http://zazzle.com/moronica");
    navigateToURL(request, "_blank");
    }




    contact.addEventListener (MouseEvent.CLICK, clickContact) ;

    function clickContact (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
    trace ("the contact button was clicked")
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("mailto: info@moronica.net");
    navigateToURL(request, "_self");
    }


    album1_btn.addEventListener (MouseEvent.CLICK, clickAlbum_btn) ;

    function clickAlbum_btn (evtObj:MouseEvent):void
    {
    //trace shows what's happening in the output window
    trace ("the album1 button was clicked")
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("itms://itunes.apple.com/us/album/hard-rock-hyper-hero/id340648752");
    navigateToURL(request, "_self");
    }


    album2_btn.addEventListener (MouseEvent.CLICK, clickAlbum_btn2) ;

    function clickAlbum_btn2 (evtObj:MouseEvent):void
    {
    //trace shows what's happening in the output window
    trace ("the album2 button was clicked")
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("itms://itunes.apple.com/us/album/clowns-from-uranus/id342086511");
    navigateToURL(request, "_blank");
    }

    album3_btn.addEventListener (MouseEvent.CLICK, clickAlbum_btn3) ;

    function clickAlbum_btn3 (evtObj:MouseEvent):void
    {
    //trace shows what's happening in the output window
    trace ("the album3 button was clicked")
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("itms://itunes.apple.com/us/album/queen-of-the_queefs/id343693701");
    navigateToURL(request, "_blank");
    }
    Last edited by superbooty; 06-07-2010 at 03:37 PM.

  8. #28
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    ok i'm going to look at this as though its a brand new problem.....I went in wrong direction or something .....first of all are you using a custom video player object or a prebuilt adobe video Object? tell me exactly how you built the player.
    ~calmchess~

  9. #29
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    I think at this point I'm going to have to hire someone - I'm not a programmer really and it's causing me undue stress...

    If you would like some work I'd be happy to send you the source files -

    mark

  10. #30
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    send me sourece i can fix it pretty quickly not that difficult of a thing to do and i'm bored to tell you the truth.
    ~calmchess~

  11. #31
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    that is extremely kind of you -

    i'm uploading the zip right now:

    http://moronica.net/home47.zip

    should be finished in about 15 minutes (75 megs)

    thank you so much!

    mark

  12. #32
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    well i only have CS3 and was unable to open the file......if you want to save it in CS3 format and i'll download again i will.
    ~calmchess~

  13. #33
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    no problem - here's a link to the CS3 version:

    http://moronica.net/home47_cs3.zip

    let me know if you have any trouble downloading it -

    Its going to take another 20 minutes to upload -

    it doubled in size from the CS4 version (150 megs!)...

    thanks again for all your help - much appreciated.

    mark

  14. #34
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    now this code definately works however there is one small problem that i need your help to resolve right now it clears the video when you click anyplace on the stage ....i did this so it could be tested.......so what event(s) takes place to stop the video?

    PHP Code:
    var vid:Video = new Video(480320);

    vid.x=231;
    vid.y=457;

    addChild(vid);

    var 
    nc:NetConnection = new NetConnection();
    nc.connect(null);

    var 
    ns:NetStream = new NetStream(nc);
    vid.attachNetStream(ns);

    var 
    listener:Object = new Object();
    listener.onMetaData = function(evt:Object):void {};
    ns.client listener;

    ns.play("compton.flv");

    stage.addEventListener(MouseEvent.CLICK,Clicks);
    function 
    Clicks(e:MouseEvent):void{
    trace("clicks");
    vid.attachNetStream(null);
    ns.close();
    vid.clear();

    ~calmchess~

  15. #35
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    that's great news!

    the video should clear when someone clicks on the "home", "info", "music", "comic", or "cartoon" buttons.

    the "blog" and "store" buttons open new windows and the "contact" opens a mail message window so those don't need the video to stop.

    the AS3 code that controls the buttons is in the first frame of the main movie in the actions layer...

    hope that helps. =

    mark

  16. #36
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    rather than give you the huge file back i'm just going to post the code for the buttons frame and the video frame


    VIDEO
    PHP Code:
    var vid:Video = new Video(480320);

    vid.x=231;
    vid.y=457;

    addChild(vid);

    var 
    nc:NetConnection = new NetConnection();
    nc.connect(null);

    var 
    ns:NetStream = new NetStream(nc);
    vid.attachNetStream(ns);

    var 
    listener:Object = new Object();
    listener.onMetaData = function(evt:Object):void {};
    ns.client listener;

    ns.play("compton.flv");



        


    this.addEventListener("stopvid",Clicks);
    function 
    Clicks(e:Event):void{
    trace("clicks");
    vid.attachNetStream(null);
    ns.close();
    vid.clear();
    if(
    vid.parent != null){
    vid.parent.removeChild(vid);
    }

    BUTTONS

    PHP Code:
    //handle events for buttons...


    home.addEventListener (MouseEvent.CLICKclickHome) ;

    function 
    clickHome (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
        
    trace ("the home button was clicked")

        
    //go to the section clicked on...
    dispatchEvent(new Event("stopvid",false,false));
    gotoAndPlay ("home start");
    }



    info.addEventListener (MouseEvent.CLICKclickInfo) ;

    function 
    clickInfo (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
        
    trace ("the info button was clicked")
        
    //go to the section clicked on...
    dispatchEvent(new Event("stopvid",false,false));
    gotoAndPlay ("info start");
    }



    music.addEventListener (MouseEvent.CLICKclickMusic) ;
    function 
    clickMusic (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
        
    trace ("the music button was clicked")
        
    //go to the section clicked on...
        
    dispatchEvent(new Event("stopvid",false,false));
    gotoAndPlay ("music start");
    }



    game.addEventListener (MouseEvent.CLICKclickGame) ;

    function 
    clickGame (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
        
    trace ("the game button was clicked")
        
    //go to the section clicked on...
    gotoAndPlay ("game start");
    }



    comic.addEventListener (MouseEvent.CLICKclickComic) ;

    function 
    clickComic (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
        
    trace ("the comic button was clicked")
        
    //go to the section clicked on...
        
    dispatchEvent(new Event("stopvid",false,false));
    gotoAndPlay ("comic start");
    }


    cartoon.addEventListener (MouseEvent.CLICKclickCartoon) ;

    function 
    clickCartoon (evtObj:MouseEvent) {
    //trace shows what's happening in the output window

        
    trace ("the cartoon button was clicked")
        
    //go to the section clicked on...
        
    dispatchEvent(new Event("stopvid",false,false));
    gotoAndPlay ("cartoon start");
    }


    blog.addEventListener (MouseEvent.CLICKclickBlog) ;

    function 
    clickBlog (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
        
    trace ("the blog button was clicked")
        
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("http://blog.moronica.net");
        
    navigateToURL(request"_blank");
    }


    store.addEventListener (MouseEvent.CLICKclickStore) ;

    function 
    clickStore (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
        
    trace ("the store button was clicked")
        
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("http://zazzle.com/moronica");
        
    navigateToURL(request"_blank");
    }




    contact.addEventListener (MouseEvent.CLICKclickContact) ;

    function 
    clickContact (evtObj:MouseEvent) {
    //trace shows what's happening in the output window
        
    trace ("the contact button was clicked")
        
    //go to the section clicked on...
    var request:URLRequest = new URLRequest("mailto: info@moronica.net");
        
    navigateToURL(request"_self");
    }


    album1_btn.addEventListener (MouseEvent.CLICKclickAlbum_btn) ;

    function 
    clickAlbum_btn (evtObj:MouseEvent):void
    {
    //trace shows what's happening in the output window
        
    trace ("the album1 button was clicked")
        
    //go to the section clicked on...
        
    var request:URLRequest = new URLRequest("itms://itunes.apple.com/us/album/hard-rock-hyper-hero/id340648752");
        
    navigateToURL(request"_self");
    }


    album2_btn.addEventListener (MouseEvent.CLICKclickAlbum_btn2) ;

    function 
    clickAlbum_btn2 (evtObj:MouseEvent):void
    {
    //trace shows what's happening in the output window
        
    trace ("the album2 button was clicked")
        
    //go to the section clicked on...
        
    var request:URLRequest = new URLRequest("itms://itunes.apple.com/us/album/clowns-from-uranus/id342086511");
        
    navigateToURL(request"_blank");
    }



    album3_btn.addEventListener (MouseEvent.CLICKclickAlbum_btn3) ;

    function 
    clickAlbum_btn3 (evtObj:MouseEvent):void
    {
    //trace shows what's happening in the output window
        
    trace ("the album3 button was clicked")
        
    //go to the section clicked on...
        
    var request:URLRequest = new URLRequest("itms://itunes.apple.com/us/album/queen-of-the_queefs/id343693701");
        
    navigateToURL(request"_blank");

    ~calmchess~

  17. #37
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    YOU DID IT!!!!!!!!!!!!

    thank you thank you thank you -

    I am so grateful for your help you have no idea...

    If there's ANYTHING I can do for you - help with a website, music, audio, animation, a logo, please let me know.

    It would be nice to know your name -

    Mark

  18. #38
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    I do need a logo for one of my sites......do you have problem with adult site logo?
    ~calmchess~

  19. #39
    Junior Member
    Join Date
    Oct 2006
    Posts
    26
    I wouldn't really but my wife sure would

    mark

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