PDA

View Full Version : Some help...


Tanktunker
06-21-2006, 01:24 PM
I looked on google to no avail.
I need AS code for making a layer appear and/or disappear.
A speedy and/or thurough answer will merit XCash.
Thanks.

groog
06-21-2006, 02:22 PM
I don't understand the question (even though I probably wouldn't be of any help anyway). Could this be solved using the visible function?

Freddy
06-21-2006, 02:28 PM
A whole layer?
umm... turn everything in the layer in to a movie clip. then use the "_visible = false" statement.

Only way I know of.

Tanktunker
06-21-2006, 02:41 PM
I'll try that and get back to you.
And yes, a whole layer.

EDIT:Not working, If I named my Movie Clip "Movie", would I be writing "Movie_visible = false"?

Jared
06-21-2006, 03:24 PM
I'll try that and get back to you.
And yes, a whole layer.

EDIT:Not working, If I named my Movie Clip "Movie", would I be writing "Movie_visible = false"?
After you make the movieclip you have to give it a instance name of whatever you want to call it with like Movie. After you click on it the instance name is under Properties. After you gave it a instance name of Movie you would call it like these
Movie._visible = false;
You can also use alpha to make it appear to fade in or fade out.
Movie._alpha = 50;
That would make it see through. Half visible and half invisible, seeing it 0 would be the same thing as setting the visible to false or seeing it to 100 would be the same as setting visible to true:)

Tanktunker
06-21-2006, 03:36 PM
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
Most._alpha = 0

Total ActionScript Errors: 1 Reported Errors: 1

The instance name for the movie clip was Most, it was on layer 2.
The button was on layer 1.
What's wrong here?

MaxManning
06-21-2006, 03:36 PM
you can also use :

setProperty(Movie,_visible,0)

Note :
If you don't use setProperty it sometimes doesn't work on older versions of the flash player.

Tanktunker
06-21-2006, 03:43 PM
Same problem.

denacioust
06-21-2006, 03:54 PM
Put it inside an onclipevent handler...

Tanktunker
06-21-2006, 04:00 PM
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Clip events are permitted only for movie clip instances
onClipEvent(Movie0._visible = False)

Total ActionScript Errors: 1 Reported Errors: 1

God I'm troublesome, aren't I?

denacioust
06-21-2006, 04:02 PM
You musta turned it into a button or a graphic, break it apart (ctrl+b, i think) and then convert it to a movie clip

Tanktunker
06-21-2006, 04:03 PM
The properties panel says "Movie Clip".

denacioust
06-21-2006, 04:04 PM
Where are you putting the script in the clip or the frame?

Tanktunker
06-21-2006, 04:05 PM
In the button.

denacioust
06-21-2006, 04:07 PM
I thought you said it was a movie clip...it should be a movie clip

Tanktunker
06-21-2006, 04:08 PM
I want a button to be pressed and then a layer will disappear.

denacioust
06-21-2006, 04:09 PM
Oh right...well put the action after an onPress action...

Tanktunker
06-21-2006, 04:11 PM
Works!
Thanks alot!