A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Object visibility

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    4

    Object visibility

    HI. I just need to turn off the visibility of TV in frame 1. When you click on the stripe at the bottom of screen you switch to frame 2 by gotoAndStop(2) method. And here it comes....when you click again on that stripe you will se that TV in frame 1 again (gotoAndStop(1))....how can i turn off the visibility of TV in frame 1?

    Link:
    Actionscript Code:
    http://testepi.kvalitne.cz/inventar_pomoci_pole.swf

    Thank for answer....

  2. #2
    Junior Member
    Join Date
    Sep 2011
    Posts
    4
    Edit: You have to click on TV in frame 1 first.....

  3. #3
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    So you want to make it invisible in Frame 1 as well, after clicking the button twice? Post your code here, and/or possibly FLA file
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  4. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    4

  5. #5
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    I am sorry, but everything that I tried, failed. I can't code in AS3, because I use AS2, and therefore nothing was like AS2, and I couldn't solve the problem, but here are a few tips:

    - Just make a third frame with the TV gone
    - Make a movieclip of the TV

    Why do you want it to return to frame 1, anyways, and be invisible?
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  6. #6
    Junior Member
    Join Date
    Sep 2011
    Posts
    4
    I know, AS3 is completely different......

    I just want to make an easy adventure game. If you click on object it will disappear and will add to inventory.....when you come back an object will be added only in inventory.....

  7. #7
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    That's quite simply to do, in AS2, as far as I know. Why are you using AS3 if you've been using AS2? If you want the code in AS2, I can write it for you
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  8. #8
    Junior Member
    Join Date
    Apr 2010
    Posts
    18
    Your issue is arising because you are trying to use AS3 syntax yet create your project in an AS1 way.

    You should be using the document class, and dynamically adding your content. Using the timeline is an AS1 way of doing things and as you can see has already gotten you into trouble before you even got very far.

    ------------------------------------------


    Here is a quick example of what I mean, how you should be controlling everything from a document class --> other classes.

    Actionscript Code:
    package _as {
       
       
       
       
       
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
       
       
       
       
       
        final public class index extends MovieClip {
           
           
           
           
           
            protected var oblast_mc : MovieClip = new oblast ( );
            protected var televize_mc: televize = new televize( );
           
           
           
           
           
            final public function index (  ) {

                this.oblast_mc.addEventListener ( MouseEvent.MOUSE_UP, this.toggleTV );
               
                this.addChild ( this.televize_mc );
                this.addChild ( this.oblast_mc );
               
            }

            final private function toggleTV ( evt : Event ) : void {

                this.televize_mc.visible = !this.televize_mc.visible;
               
            }
           
           
           
           
           
        }
       
    }
    Last edited by truimagz; 09-26-2011 at 04:55 PM.

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