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 5 of 5

Thread: Problem start movie after stop

  1. #1
    Junior Member Settled In mikie is on a distinguished road
    Join Date
    Jun 2008
    Posts
    5
    Rep Power
    0

    Problem start movie after stop

    amazing Flash templates
    I've got loading bar on my movie clip and when load completes I need movie to continue playing
    here is my source:
    Code:
    var mc = new MovieClip();
    root.addChild(mc);
    
    mc.addEventListener(Event.ENTER_FRAME,Loadiing)
    
    function Loadiing(event:Event)
    {
    
        
        this.pre_txt.text = int(stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal * 100) + "%"
    
        if (this.pre_txt.text == "100%")
        {    
            
    
            mc.parent.removeChild(mc);
            root.play();
    
    
        }
    }
    it gives me an error:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at ***_fla::MainTimeline/Loadiing()

    how can I fix it?

  2. #2
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,457
    Rep Power
    8

    Re: Problem start movie after stop

    Hi mikie,
    how many frames do you have in main timeline ?
    Where that code is ? Frame one ?

  3. #3
    Junior Member Settled In mikie is on a distinguished road
    Join Date
    Jun 2008
    Posts
    5
    Rep Power
    0

    Re: Problem start movie after stop

    Quote Originally Posted by Flep View Post
    Hi mikie,
    how many frames do you have in main timeline ?
    Where that code is ? Frame one ?
    There are 550 frames and my script runs on 26-th frame

    oh and i forgot, first I use stop(); and than use code above

  4. #4
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,457
    Rep Power
    8

    Re: Problem start movie after stop

    I think you should keep your main timeline with 1 frame only.
    Put your animations inside e MovieClip and manage it instead of manage the maintimeline.

    With that way you'll have less problems.

  5. #5
    Junior Member Settled In mikie is on a distinguished road
    Join Date
    Jun 2008
    Posts
    5
    Rep Power
    0

    Re: Problem start movie after stop

    Quote Originally Posted by Flep View Post
    Hi mikie,
    how many frames do you have in main timeline ?
    Where that code is ? Frame one ?
    thanks for answers, I've found a solution, Here is code example
    Code:
    stop();
    
    
    root.addEventListener(Event.ENTER_FRAME,Loadiing)
    
    function Loadiing(event:Event)
    {    
    
        this.pre_txt.text = int(stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal * 100) + "%"
    
        if (this.pre_txt.text == "100%")
        {            
            removeEventListener(Event.ENTER_FRAME, Loadiing);        
            gotoAndPlay(frameNo);
        }
    }
    And everything works perfectly

+ Reply to Thread

Similar Threads

  1. Load movie/store movie name in variable
    By xFlashStudentx in forum advanced Actionscript 3.0
    Replies: 2
    Last Post: 22-01-10, 21:29
  2. Game Start Function?
    By celestialsunberry in forum Actionscript for beginners - tutorials
    Replies: 0
    Last Post: 09-01-10, 00:40
  3. Need Help to fix this ImagePoll to start to work Flash/php
    By pero in forum HELP free utilities
    Replies: 0
    Last Post: 22-06-08, 10:52
  4. Problem start movie after stop
    By mikie in forum Actionscript 3.0 base
    Replies: 0
    Last Post: 04-06-08, 12:01
  5. bypassing stop(); in AS3 and moving a movie?
    By getosled in forum Flash English
    Replies: 16
    Last Post: 11-10-07, 14:46

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