• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

Customising Flash Components

I would like to add certain things to the FListBox component (like highlighting the selection onRollOver).

I have done this...but I have edited the actual component which I have read is not what I should be doing. (Apart from that all changes I make are global and apply to comboboxes as well - which is not really what I want).

So I tried to copy the ListBox (with a view to editing the code on this one) but the copy could not even display items.

I suppose what I'm looking for is a short guide to explain how to copy and customise the existing Flash component library without altering the existing components.
0
JohnHowlett
Asked:
JohnHowlett
  • 3
  • 2
  • 2
1 Solution
 
ZefferCommented:
if you drop a component onto the stage Flash..you can then
go into editing mode (edit symbols) and change whatever you
like..you're only altering an instance of the original component.
if you then want to re-use that altered component as a template..
save the file as .fla and then in a new .fla open the saved.fla as a library (File>Open as Library)

you can also change the properties of a component instance
with the FStyleFormat object constructor..
see Help..ActionScript Dictionary Overview>FStyleFormat (object)..also..Using Flash>Using Components>Changing the properties of specific components

Z
0
 
JohnHowlettAuthor Commented:
Thanks for the reply....

Ok...so I've got my new ListBox (ListBox2)...but it is still pointing to all the global properties

How do I change the colour of the highlight box without affecting the global settings?

I have duplicated 'FHighlight' (FHighlight2) and have it containing a 'Highlight2' in the 'other assets' folder.

Where is the line/property I need to change to have my new ListBox pointing to these highlight properties?

(Or is this totally the wrong way of doing it??)

0
 
henrywwCommented:
i am not sure if that's what u want ...
if u only want to change the highlight of one UI ...

list1.setStyleProperty("selection", 0x336699);
list1.setStyleProperty("selectionUnfocused", 0x3399FF);

see if that helps
http://www.smartclever.net/example/flash/selcolor/selcolor.swf
http://www.smartclever.net/example/flash/selcolor/selcolor.fla
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
JohnHowlettAuthor Commented:
Thanks henryww...I didn't know that.

But I would still like to be able to add my 'onRollOver' highlight (as well as giving the highlight a gradiant fill).
0
 
ZefferCommented:
drag a list box to the stage
in edit symbols..run out to global skins and select FHighlight
double click the movie there and you can change the
fill in the properties panel (don't believe everything they
tell you in Help:))

back on main stage select the listbox..put in a
label or two in the parameters box [on properties panel]..(so you can see it work)
test..click a label..there you go.

save this .fla file..as  listBox2.fla
open a new .fla..
import as library ..listbox2.fla
drag an instance of a listbox to the stage
put in some labels
test

you've customised a listbox component
saved it as a 'template'..
and re-used it..a
nd the original component is unchanged.

mechanical..but works.

if you want to make changes purely with code..
look up..FStyleFormat object..in ActionScript Dictionary.

Z





0
 
henrywwCommented:
ok there's the highlight
same links as above.

http://www.smartclever.net/example/flash/selcolor/selcolor.swf
http://www.smartclever.net/example/flash/selcolor/selcolor.fla 

change the "rollOver highlight" from the library for the color ...
0
 
JohnHowlettAuthor Commented:
Thanks very much ...this is a great help!
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now