The Window component class takes care of creating a title for you.
You don't need to do anything, just set the .title property on the Window 
instance.

If for some reason you want to put your own title textfield in the header, 
you'll need to have a movieclip (instance name 
'title_mc') that contains a textfield (instance name 'text') inside your custom 
TitleBackground.

The textfield might get affected by the stretching of the TitleBackground 
though, so not sure how well this will work out.

regards,
Muzak

----- Original Message ----- 
From: "Andrew Sinning" <[EMAIL PROTECTED]>
To: "Flash Coders" <[email protected]>
Sent: Friday, May 18, 2007 9:39 PM
Subject: [Flashcoders] how to access custom TitleBackground 
(skinTitleBackground) of Window


> I've created a TitleBackground movieClip by following the instructions in the 
> MX04 online help "To set the title of an Window 
> component to a custom movie clip symbol" (below). Now I'd like to make a call 
> to a function inside of that clip or access 
> properties within that clip directly. The window has a property 
> skinTitleBackground the value of which is an object of type 
> "TitleBackground", but TitleBackground doesn't have any public properties. 
> Inside my TitleBackground movieClip there is a 
> TextField called "titleText" that I would like to be able to set the text of. 
> So far the only way I've been able to change it is 
> by having a loop within the movieClip check on the value of an external 
> variable. There should be another way, right?
>
> Here are the instructions I followed. Thanks!
>
> 1. Create a new FLA file.
> 2. Create a new symbol by selecting Insert > New Symbol.
> 3. Set the name to TitleBackground.
> 4. If the advanced view is not displayed, click the Advanced button.
> 5. Select Export for ActionScript.
> 6. The identifier will be automatically filled out with TitleBackground.
> 7. Set the AS 2.0 class to mx.skins.SkinElement.
>
> SkinElement is a simple class that can be used for all skin elements that 
> dont provide their own ActionScript impelmentation. It 
> provides movement and sizing functionality required by the version 2 
> component framework.
> 8. Ensure that Export in First Frame is already selected, and click OK.
> 9. Open the new symbol for editing.
> 10. Use the drawing tools to create a box with a red fill and black line.
> 11. Set the border style to hairline.
> 12. Set the box, including the border, so that it is positioned at (0,0) and 
> has a width of 100 and height of 22.
>
> The Window component will set the proper width of the skin as needed but it 
> will use the existing height as the height of the 
> title.
> 13. Click the Back button to return to the main Timeline.
> 14. Drag the Window component to the Stage.
> 15. Select Control > Test Movie.


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to