Sunday, April 4, 2010

hiding a layer through action script

hi all,

I've done some searching and it looks like you cant hide a layer using action script. I'm going to have a page with a lot of form controls on it and when the user clicks the submit button, i want all those controls to go away so that i can display something else.

I really dont want to have to do control._visible = false for every single item. I did see one person saying i could attach those form fields (movieclips) to a parent movieclip, and then just make the parent visibl = false. would that be the best way to hide a bunch of controls without explicitly setting the visability on each movieclip? if so, how do i make something the child of a parent clip?

thanks

hiding a layer through action script

Essentially, anything you add into a timeline is a child of that timeline. Right now you should be able to select all the controls you want to hide at the same time, right click, and select Convert To Symbol-%26gt;MovieClip.?They will immediately become children of the movieclip you just created.

hiding a layer through action script

sorry i'm a complete newb to flash/actionscript. you've lost me a bit. If i have a bunch of form fields, and i convert them all to one symbol/movieclip, how do i access the values of each of the form fields?

for example, say i had two comboboxes, cbox1 and cbox2 - in my action script i can do cbox1.text to find out what the user selected, but once i convert them all to one symbol, that no longer works.

I need some way to hide them all but still access their values.

Select the movieclip you placed them in and in the properties panel give it an instance name.?Then, whenever you want to deal with something inside it, use that instance name...

yourInstanceName.cbox1.etc....

just had a thought - since my form exists only in one frame, can i just increment to the next frame to hide all the form related stuff and then starting in the 2nd frame, start showing the results of the form submit? how do you go to the next frame (or a specific frame for that matter) in AS 3.0?

thanks

ahhhhh! i see! let me give that a try and see if it works. thanks!

You're welcome

No comments:

Post a Comment