Flash Gallery | Flash Templates | Flash Menu | Flash Design | Flash Audio & Video

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Results 1 to 7 of 7

Thread: Events are freezing

  1. #1
    Junior Member Settled In MarreMupp is on a distinguished road
    Join Date
    Dec 2007
    Posts
    4
    Rep Power
    0

    Events are freezing

    amazing Flash templates
    I´ve a videorecorder application. I start the recording, but after a while everything is freezing: The buttons (previous, record/pause and next) stops working and the timer stops counting. Anyone who knows what the problem could be? Why does events just stop working like this? Are the objects Garbage Collected? If so, should all display objects be global?

  2. #2
    Moderator Moving My Stuff To The FlepStudio tem is on a distinguished road tem's Avatar
    Join Date
    Jan 1970
    Posts
    639
    Rep Power
    41

    Re: Events are freezing

    Hi!

    just to get what's gowin' wrong..
    are you using the same timer to handle different functions?

  3. #3
    Junior Member Settled In MarreMupp is on a distinguished road
    Join Date
    Dec 2007
    Posts
    4
    Rep Power
    0

    Re: Events are freezing

    When pressing the record button the count-down timer starts - 3 seconds. When finished, the count-up timer and the recording starts.

  4. #4
    Moderator Moving My Stuff To The FlepStudio tem is on a distinguished road tem's Avatar
    Join Date
    Jan 1970
    Posts
    639
    Rep Power
    41

    Re: Events are freezing

    Hi..
    it's hard to guess..
    you can post some code to see what's gowin' wrong?

  5. #5
    Junior Member Settled In MarreMupp is on a distinguished road
    Join Date
    Dec 2007
    Posts
    4
    Rep Power
    0

    Re: Events are freezing

    The problem seems to be in my presentation class that handles different layouts and events. Here´s the first method wich creates the start interface, where the user can choose recording type. If you want some more code I can upload the whole code.
    Code:
    private function createStartUI(_created:Boolean=false):void
    {
        if ( _created == false )
        {    
            container_startUI = new Sprite();
            
            container_startUI.addChild( graphic.createTopBanner("1/4 - Vad vill du spela in?") );
            
            var video_btn:OptionButton = new OptionButton();
            video_btn.text_txt.text = "Video";
            video_btn.x = _stage.stageWidth/2 - 100;
            
            var audio_btn:OptionButton = new OptionButton();
            audio_btn.text_txt.text = "Ljud";
            audio_btn.x = _stage.stageWidth/2 + 100;
            
            // Adds a tweening effect to the button (or not)
            //var option_btn_tween:Tween = new Tween(option_btn, "y", Elastic.easeOut, 0, _ypos, 3, true);
            var video_btn_tween:Tween = new Tween(video_btn, "y", Elastic.easeOut, 0, _stage.stageHeight/2 + 30, 3, true);
            var audio_btn_tween:Tween = new Tween(audio_btn, "y", Elastic.easeOut, 0, _stage.stageHeight/2 + 30, 3, true);
            
            // Video button
            function videoButtonEventHandler(event:MouseEvent):void
            {
                switch(event.type)
                {
                    case "click" :
                        container_startUI.visible = false;
                        _interface = "video";
                        createRecordingUI();
                        break;
                        
                    case "mouseOver" :
                        video_btn.alpha = 0.9;
                        break;
                        
                    case "mouseOut" :
                        video_btn.alpha = 1;
                        break;
                }
            };
            video_btn.addEventListener(MouseEvent.CLICK, videoButtonEventHandler, false, 0, true);
            video_btn.addEventListener(MouseEvent.MOUSE_OVER, videoButtonEventHandler, false, 0, true);
            video_btn.addEventListener(MouseEvent.MOUSE_OUT, videoButtonEventHandler, false, 0, true);
            
            // Audio button
            function audioButtonEventHandler(event:MouseEvent):void
            {
                switch(event.type)
                {
                    case "click" :
                        container_startUI.visible = false;
                        _interface = "audio";
                        createRecordingUI();
                        break;
                        
                    case "mouseOver" :
                        audio_btn.alpha = 0.9;
                        break;
                        
                    case "mouseOut" :
                        audio_btn.alpha = 1;
                        break;
                }
            };
            audio_btn.addEventListener(MouseEvent.CLICK, audioButtonEventHandler, false, 0, true);
            audio_btn.addEventListener(MouseEvent.MOUSE_OVER, audioButtonEventHandler, false, 0, true);
            audio_btn.addEventListener(MouseEvent.MOUSE_OUT, audioButtonEventHandler, false, 0, true);
    
            container_startUI.addChild(video_btn);
            container_startUI.addChild(audio_btn);
            _stage.addChild(container_startUI);
        }
        else
        {
            trace("container_startUI: "+container_startUI);
            container_startUI.visible = true;
        }// End of IF
    };

  6. #6
    Junior Member Settled In MarreMupp is on a distinguished road
    Join Date
    Dec 2007
    Posts
    4
    Rep Power
    0

    Re: Events are freezing

    I tried to global the record button by initiating the variable in the class. I pressed back- and forward buttons a couple of times and everything was freezing, except the record button. It seems that the objects got garbage collected. I´ve to rebuilt the class to make sure this is the sulution. And I think I should remove the objects and their events instead of just hiding them - more CPU and memory effective.

  7. #7
    Moderator Moving My Stuff To The FlepStudio tem is on a distinguished road tem's Avatar
    Join Date
    Jan 1970
    Posts
    639
    Rep Power
    41

    Re: Events are freezing

    Hi, sorry but I didn't noticed your answer (since now..)
    I'm sorry but looking at your code I just found things that I don't use often..
    perhaps if you post a .fla sample with the error i can try to figure out..

+ Reply to Thread

Similar Threads

  1. Events Scroller
    By Flep in forum FlepStudio utilities
    Replies: 42
    Last Post: 31-01-10, 04:11
  2. Events Scroller - version 2
    By Flep in forum FlepStudio utilities
    Replies: 23
    Last Post: 20-01-10, 03:12
  3. Focus events
    By xFlashStudentx in forum advanced Actionscript 3.0
    Replies: 0
    Last Post: 26-10-09, 02:58
  4. Scroller Events
    By frgooall in forum Components
    Replies: 0
    Last Post: 11-08-08, 01:19
  5. Custom events - EventDispatcher
    By Flep in forum Tutorials
    Replies: 0
    Last Post: 23-09-07, 17:37

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Optimization by vBSEO