header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
syeddiwan
Points:0
Posts:0

5/10/2010 1:55:19 AM

Title: how to apply the difference css file to each module instance


i have one doubt for setStyle methode in flex frame work,
i can load the css file at run time to module using styleManger, but my question is if we are using one module instance mean so issue, At the same i want to use difference css file to each module instance,here only i am struggle because styleManager is single ton, it's taking only last style definition, For this case we loop through the display object and using setStyle method to apply corresponding style to that displayObject...
I read lot of Flex performance article ,they recommend to avoid setStyle method ,For this case any other alternative way is there,





1
Friend
Points: 690
Posts:0
5/10/2010 5:24:06 AM



when you apply styles on runtime they take some time to apply , that's the only performance issue. The time depends upon the number of components in an application , An application with 100 components can take upto 1 sec to apply the seconds, what i noticed.Once applied there is no performance issue later on, so you can use runtime style if you are willing to spare some milliseconds for application start up.

you can use this code to load external stylesheet:
StyleManager.loadStyleDeclarations("CSS/myStyleSheet.swf",true,false,ApplicationDomain.currentDomain);


2
syeddiwan
Points: 0
Posts:0
5/10/2010 6:49:23 AM



hi friend ,
if there is one module instance mean no issue, but i am creating two instance for same module in HBox conatainer, here i can load the different css file to each of them, But it is not taking different style definition, Both of them taking last style definition, Beacause StyleManager taking last style definition,

so only we are loop through the displayObject and apply corresponding style to them, for this methodology we are using setStyle method,



3
Rex
Points: 1180
Posts:0
5/10/2010 12:42:37 PM



StyleManager is singleton class so the most recent loaded stylesheet is applied to application and modules. An approach is discussed in the below article to apply different styles in modules, hope its useful to you

http://viconflex.blogspot.com/2007/04/flex-modules-compile-and-run-time-css.html

4
syeddiwan
Points: 10
Posts:0
5/10/2010 9:43:20 PM




yes guys,using StyleManager is not possible, any other alternative way to do this,


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 3+5 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions