That is awesome. Is there anyway you can provide some sample code? It
would be hugely appreciated. Perhaps even point me to the
tutorials/samples/help files you used to make it. It sounds like exactly
what I am looking for and the best solution until the next version of Flex
which will apparently separate the CSS out properly.
Regards,
Collin
On 12/10/06, Austin Kottke <[EMAIL PROTECTED]> wrote:
Hi,
I've been able to get around this problem, by creating a single mxml file
that embeds the stylesheet I want to. The entire mx file is just an embedded
css file.
I then do all of my 9scale png setup etc, styles on the buttons etc.
I then compile this with ant into a single SWF with ant and put it into my
themes directory automatically with ant.
I then load in the SWF -- AS soon as the SWF is loaded it instantly
applies all of my CSS styles and everything because of the original embed
tag. I dont have to do setStyle on anything because once the SWF gets loaded
it instantly applies the styles.
Once the SWF is loaded I then create the interface which then uses
whatever themes are set based on the CSS stylesheet.
I find this great because I can do runtime theme switching on the fly by
compiling themes into different SWFs.
You can also use this same procedure to compile in external modules, etc
-- similar to the IOC - Inversion of control design pattern to create very
re-usable plugins - similar to dll functionality.
Let me know if this helps.
Best, Austin
*{reduxdj} <[EMAIL PROTECTED]>* wrote:
Dimitrios:
This is exactly the feature I'm looking for.. we have themes that the
user can select, i'll
just have to bind the color property for now. I wonder why this feature
was left out.
Thanks,
Patrick
Dimitrios Gianninas wrote:
>
> Wait for 2.01 coming soon after holidays (don't quote me on that) for
> the CSS portion.
>
> As for 18n, we will have to wait a bit longer.
>
> *Dimitrios Gianninas*
> *RIA Developer*
> *Optimal Payments Inc.*
>
>
> ----------------------------------------------------------
> *From:* [email protected] <flexcoders%40yahoogroups.com>[mailto:
[email protected] <flexcoders%40yahoogroups.com>]
> *On Behalf Of *Collin Peters
> *Sent:* Sunday, December 10, 2006 2:45 AM
> *To:* [email protected] <flexcoders%40yahoogroups.com>
> *Subject:* Re: [flexcoders] styleSheets, loading from run-time from a
> .css file and not fom a swf
>
> I would also like to know the full answer to this question. It says
> here: http://www.adobe.com/devnet/flex/samples/flex_store/
> <http://www.adobe.com/devnet/flex/samples/flex_store/> that
> "Currently, Flex 2 does not support the run-time loading of style
> sheets."
>
> I assume from this statement that we can look for this feature in the
> future. One of the things I haven't liked about flex is that
> resources must be embedded most of the time. Both CSS and I18N
> resources have to embedded. That means if I wanted a flex app where
> the user has a choice of 10 skins with support for 10 languages I
> would have to create 100 builds of the same flex app. This is, of
> course, for real skinning and not just CSS as you can always embed
> multiple CSS files (in which case you still would have to rebuilt the
> entire app to make a change to the css file)
>
> In this presentation:
> https://admin.adobe.acrobat.com/_a200985228/p24244278/
> <https://admin.adobe.acrobat.com/_a200985228/p24244278/> it is stated
> that you can use setStyle for runtime changes of styles but that it is
> not very efficient.
>
> Any gurus have some more answers for this topic?
>
> Regards,
> Collin Peters
>
> On 12/9/06, {reduxdj} <[EMAIL PROTECTED] <dj%40reduxdj.org> <mailto:
dj%40reduxdj.org>> wrote:
>
> > I read that flex supports stylesheets embedded into swf files that can
> > be loaded at run time. Is it possible to load a stylesheet, and with
> > the styleManager apply my styles at run time. I basically want to
> > recolor everything in my app with one button click thanks.
> >
> > What's the best practice for this, it looks like there's almost a
> > plethora of different solutions.
> >
> > Thanks,
> > Patrick
> >
>
> *AVIS IMPORTANT*
>
>
>
> *WARNING*
>
> Ce message électronique et ses pièces jointes peuvent contenir des
> renseignements confidentiels, exclusifs ou légalement privilégiés
> destinés au seul usage du destinataire visé. L'expéditeur original ne
> renonce à aucun privilège ou à aucun autre droit si le présent message
> a été transmis involontairement ou s'il est retransmis sans son
> autorisation. Si vous n'êtes pas le destinataire visé du présent
> message ou si vous l'avez reçu par erreur, veuillez cesser
> immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
> jointes, de votre système. La lecture, la distribution, la copie ou
> tout autre usage du présent message ou de ses pièces jointes par des
> personnes autres que le destinataire visé ne sont pas autorisés et
> pourraient être illégaux. Si vous avez reçu ce courrier électronique
> par erreur, veuillez en aviser l'expéditeur.
>
>
>
> This electronic message and its attachments may contain confidential,
> proprietary or legally privileged information, which is solely for the
> use of the intended recipient. No privilege or other rights are waived
> by any unintended transmission or unauthorized retransmission of this
> message. If you are not the intended recipient of this message, or if
> you have received it in error, you should immediately stop reading
> this message and delete it and all attachments from your system. The
> reading, distribution, copying or other use of this message or its
> attachments by unintended recipients is unauthorized and may be
> unlawful. If you have received this e-mail in error, please notify the
> sender.
>
>
------------------------------
Any questions? Get answers on any topic at Yahoo!
Answers<http://answers.yahoo.com/;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx>.
Try it now.
--
Collin Peters
Lead Software Developer