Topic: Newbie Flash Question - Textfields
I'm an experienced programmer, but a Flash/ActionScript newbie. I've got a couple of Flash & AS books on order from Amazon, but I'm impatient to get a widget up and working and have a (I think) simple question:
Using the example webcam widget, I'm creating a near-clone of that script which is grabbing an image from a different web cam. I've figure out how to scale the image and render some static text, but I need to display a timestamp on the image as well. The basic code to do that turned out to be pretty easy, but I've realized I need to provide an all-black rectangle background to be able to consistently read the text -- if I render it directly on the webcam image the background color sometimes washes out the text.
My problem is that I really don't understand the display/rendering order of ActionScript (or perhaps even the programming model). Is there one script per .fla file? --or one script per object? --or something else?
I currently have two layers in my .fla file -- on called 'Camera' and one called 'Background'. 'Background' just contains a black rectangle. 'Camera' has the script attached to it -- it's pretty much a clone of the example webcam .fla file. It correctly renders the webcam image and I can do createTextField("xxx",...); xxx.text = "blah"; and it renders on top of the webcam "movie" just fine. I can order the layers so that the black rectangle shows up "on top" of the camera layer -- but how do I render text on top of the rectangle?
I thought perhaps I could name it explicitly in the script (i.e., Background.createTextField("xxx",....), etc.) -- but this doesn't appear to work. What is the correct way to do this?
-M.