views:

251

answers:

1

Hello Stackoverflowers,

I'm making a social community application with profile. User must be able to style their profiles. That's why i'm looking for a way to store and retrieve color values from a MySql database to style flex 3 components at runtime. Does anybody know how i could accomplish this. (I don't want to use Runtime css swf styles.)

My guess is that i must store and retrieve hexcolor values (0xFFFFFF). and than something like getStyle and a setStyle. maybee a changehandler But how?

Does anybody have an example how i could accomplish this.

What i want to do is give users the ability to style their profiles via colorPickers. Than i want to store the chosen colorvalues in the DB. Next i want to retrieve the stored colorvalues form the DB when somebody visits the styled profile.

meaning

choose border Color for a panel with a colorPicker. save the value in the DB's retrieve the panel border Color value from DB when the profile is requested form the server.

choose fill Color for a button with colorPickers. save the values in the DB's retrieve the button fill Color value from DB when the profile is requested form the server.

also.

i must say i have one profile page (template). So when a user visits another users profile page that also have been styled The colors of components must change.

i hope its clear what i'm trying to do.

Can anybody help me out with a good example?

Thank

DJ

A: 

Just a guess but you could use programatic skinning with a reference to a colour chooser classes static variable. On main init call your service, retrieve the colour then call invalidateDisplayList().

To test this, have a simple app with one skinned control. This controls skin makes reference to a var in the colour chooser class to get its colour. Have two buttons, one to update the variable in the colour chooser class and another to call invalidateDisplayList(). The second button should re-draw with the new colour. If that works id imagine your good to go.

Its late so this could be complete bollocks but give it a go.

Jammin