Denaes
04-17-2006, 02:48 PM
Just re-starting to learn how to transplant my Java & .Net knowledge over to Flash and I had a few things come up that I just don't seem to be able to find an answer for.
Saying you're going with a normal Flash movie with a timeline (and not Forms), I might decide to add a few movie clips to the application, which contain controls and maybe images.
Just to be easy, assume I have a clip created called Name_mc with a textbox in it called Name_txt & a button called Send_btn.
First I was wondering about events. I can get an event handler to work within the same frame/level of the movieclip, but how would you assign a function on the main clip to listen for an event comming from a control within a MovieClip? Say I wanted to subscribe to Name_txt's "change" event? Or Send_btn's press event?
Next, I have a problem getting at the variables within a movie clip. I can get to "this.Name_mc.Name_txt.text" just fine to get the text from the textbox. But I can't seem to be able to create a variable on the instance that I can access from outside of the movie clip. Is there a particular way I have to expose properties/methods I'd want to use from outside?
The same as above, but applything the properties/methods with a SWF file. Does the SWF work the same as a movie clip once you have it in place?
Probobly the first question I should have asked, but would it be better (or even possible) to create a custom control with these many other controls (and their logic) in it and exposing properties/methods for outside use?
I seem to have scope down fine with classes with the whole public/private thing, but these don't seem to apply on a frames code.
I know most of this is Noob stuff, but the books I have are covering solely actionscript 2.0 and OOP techniques or making animation. I seem to not be able to find this one aspect I'm looking for.
Saying you're going with a normal Flash movie with a timeline (and not Forms), I might decide to add a few movie clips to the application, which contain controls and maybe images.
Just to be easy, assume I have a clip created called Name_mc with a textbox in it called Name_txt & a button called Send_btn.
First I was wondering about events. I can get an event handler to work within the same frame/level of the movieclip, but how would you assign a function on the main clip to listen for an event comming from a control within a MovieClip? Say I wanted to subscribe to Name_txt's "change" event? Or Send_btn's press event?
Next, I have a problem getting at the variables within a movie clip. I can get to "this.Name_mc.Name_txt.text" just fine to get the text from the textbox. But I can't seem to be able to create a variable on the instance that I can access from outside of the movie clip. Is there a particular way I have to expose properties/methods I'd want to use from outside?
The same as above, but applything the properties/methods with a SWF file. Does the SWF work the same as a movie clip once you have it in place?
Probobly the first question I should have asked, but would it be better (or even possible) to create a custom control with these many other controls (and their logic) in it and exposing properties/methods for outside use?
I seem to have scope down fine with classes with the whole public/private thing, but these don't seem to apply on a frames code.
I know most of this is Noob stuff, but the books I have are covering solely actionscript 2.0 and OOP techniques or making animation. I seem to not be able to find this one aspect I'm looking for.