• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

when object is remove then it can't create again

Explorer ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

Hi there is an problem I can't understand why this is happening

when user send one string to video class then this creates object for that request, if again user send same request then it can't create object.

see www.fltech.in/tab2

1) Click on any product,

2) then guy stands and ask something

3) after that youtube video will appear <skip that>

4) you will see the form

5) fill that form or you can leave that as it is click on close button,

6) click on same product which you click last time <<< ERROR HERE

here is my video class

///////////////////////////////////

package code {

          import flash.display.MovieClip;

          import code.walktv;

          import code.walkcamera;

          import code.walklaptop;

          import code.walkphone;

 

          public class allvideos extends MovieClip{

                    private var video:MovieClip

 

                    public function allvideos() {

                    }

 

                    public function playvideo(str:String):void{ <<<this function plays videos

 

                              if(str=='tv'){

                                        video=new walktv()

                                        addChild(video)

                                        video.x=502;

                                        video.y=-51;

                              }else if(str=='phone'){

                                        video=new walkphone()

                                        addChild(video)

                                        video.x=425

                                        video.y=-67

                              }else if(str=='camera'){

                                        video=new walkcamera()

                                        addChild(video)

                                        video.x=503

                                        video.y=-48

                              }else if(str=='laptop'){

                                        video=new walklaptop()

                                        addChild(video)

                                        video.x=500

                                        video.y=-84

                              }

                    }

 

                    public function continuevideo(){

                              video.play()

                    }

 

                    public function stopvideo():void{

                              video.stop()

                              removeChild(video)

 

                              MovieClip(parent).gotoAndStop('reset')

                    }

          }

}


TOPICS
ActionScript

Views

867

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

rewind your video and then play it

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

It dosent work..

before remove child i stop Movieclip on frame1,

but it is not visible again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

show the code that does that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

see the code on above

I play video by playvideo function and i stop video by stop video function and i show waiting video of guy.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

that's not rewinding the video.  use:

   public function stopvideo():void{

                              video.gotoAndStop(1);

                              removeChild(video)

                              MovieClip(parent).gotoAndStop('reset')

                    }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

yes I already tried this, but this can't solve my problem. If video is stuck on last frame then it must show last frame of video but it shows nothing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

LATEST

your last message doesn't make sense.

the code i suggested will work unless you have other code that changes video's frame and that executes after that gotoAndStop.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines