mx:String is special-cased in the compiler.  File an enhancement request at http://www.macromedia.com/go/wish for the do-not-parse capability.  Currently the backslash technique you found is the only way to do it if I remember right.

 

Matt

 

 


From: Erik Westra [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 1:37 AM
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders] Execute code before any component is put on the stage

 

Yeah I thought of that solution too. What works too is escape the {and
}.

Mx:String is not a actionscript class as faras I can tell, if it was I
could simply subclass it...

Just wondering: how hard would it be to add a tag to flex that wont
parse the content passed with a source attribute?


Greetz Erik


-----Original Message-----
From: Dirk Eismann [mailto:[EMAIL PROTECTED]
Sent: dinsdag 22 februari 2005 10:32
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Execute code before any component is put on
the stage


Hi Erik,

the only way of compiling external files into a Flex app I know of is to
use the "source" attribute of the Script, Style, Model or XML tags.
Maybe the last one works for you if you do something like this (not
tested, just an idea):

1) Define an external XML file with just onenode. This node is a CDATA
node that won't get parsed as XML.
2) Place your CSS definitions into this CDATA block.
3) Pull the file into your app during compile time with the mx:XML tag
and parse it afterwards

<!-- inside your mxml file -->
<mx:XML id="styleData" source="externalCSS.xml" >

<!-- externalCSS.xml -->
<?xml version="1.0" encoding="utf-8"?>
<style>
  <![CDATA[
  myStyle {
    font-size: 42;
    font-weight: bold;
  }
  ]]>
</style>

You'll then have to parse the CDATA part by your self, of course.

Dirk.


-----Original Message-----
From: Erik Westra [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 10:17 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Execute code before any component is put on
the stage


Hmm, this is an interesting idea.

I still have one small problem though. When i use this MXMLObject
interface my code will be run before the visual mxml components, right?
But in the code i need to load an external ini file, wich could take
some time. When its loaded, some visual components mich be on the stage.
A possible solution was to use the <mx:String> tag. This way the content
would be included in the swf.

There is however one problem with the <mx:String> tag, it tries to parse
the string thats in the source. And with css files, { and } are pretty
common...

So is there a way to include a string in a flex application (compile
time) without having it parsed?


Greetz Erik



Yahoo! Groups Links








Reply via email to