what you trying to accompllish ?. Do you want to set styles on the fly or you are trying to set style sheet path dynamically ?
On the fly, lets say that I put a text box that will let you to choose the button style.
1 person found this helpful
in this case StyleManager.loadStyleDeclarations(currentTheme + ".swf"); can come handy.This satement will load new style Declarations for your application on runtime whenever you want.
currentTheme will be your css file containing styles compiled into swf by flex builder you can do that by right clicking on css file and selecting
Compile Css To Swf
for more information on style Manager see following link
Ok I fallow your instructions but some weird things happening when I am trying to use it.
First I executed the StyleManager.loadStyleDeclarations(_mapStyle)
then I am creating my buttons.
But when I am running the program I see how the buttons created first, then after all the buttons been created, even the one who already exist b4 I executed the StyleManager.loadStyleDeclarations(_mapStyle) are getting the new style settings from _mapStyle(you can see it right now if you enter the site)
Do you got any idea about how to fix it?
you can use Class Selector in css rather Then type Selector you probbably be doing something similar in your css
this will apply style on all buttons in your application as its currently happening so you may use class Selector instead like this
then the grid of buttons you are making you can use Such statement
Var b:Button=new Button()
Yeah it is working now, I had some troubles at the beginning but now I can see what did you meant.
Tnx a lot.