Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Shiny7 #1
ToScript()
the livedocs are littered with examples of converting a coldfusion variable to
javascript by means of ToScript(), but it doesn't show any examples of
converting to actionscript. I'm trying to figure out when and how you would
use this. the docs say the generated script can be passed into flashform
attributes. but what's an example of why you might do this, and how would you
do it?
Shiny7 Guest
-
Mike Nimer #2
Re: ToScript()
If you were writing some onClick in the actionscript that looped over an
array of values, maybe to add to a select list. You could use ToScript to
generate the string that is the actionscript array. The only difference
between the javascript and the actionscript version is that the javascript
uses "= new Array()" and "= new Object()" but the actionscript uses the
shortcuts "= []" and "= {}", because new is a reserved word in flash forms.
--nimer
"Shiny7" <webforumsuser@macromedia.com> wrote in message
news:cvnmkr$4af$1@forums.macromedia.com...> the livedocs are littered with examples of converting a coldfusion
> variable to
> javascript by means of ToScript(), but it doesn't show any examples of
> converting to actionscript. I'm trying to figure out when and how you
> would
> use this. the docs say the generated script can be passed into flashform
> attributes. but what's an example of why you might do this, and how would
> you
> do it?
>
Mike Nimer Guest
-
-
Shiny7 #4
Re: ToScript()
so how can we pass a an actionscript date object into a component? using toScript always uses new Date(), which is illegal in cf7
Shiny7 Guest
-
Mike Nimer #5
Re: ToScript()
You would use FlashRemoting to pass from Actionscript to CF, either way
actually. Not toScript().
With the flash forms we compile cf to flash, this is the only place. So the
actionscript you place in an onClick="" attribute is compiled right into the
actionscript. This is when you want to use the actionscript version of
toScript(). For regular CF->Flash transfer of data you would use Flash
Remoting instead.
---nimer
"Shiny7" <webforumsuser@macromedia.com> wrote in message
news:d08qgv$dug$1@forums.macromedia.com...> so how can we pass a an actionscript date object into a component? using
> toScript always uses new Date(), which is illegal in cf7
Mike Nimer Guest
-
Shiny7 #6
Re: ToScript()
i guess the underling question is... how to create a date object in flash
forms. cf is gonna cry when using the actionscript 'new Date()' because
of the illegal use of the 'new' keyword in flash forms. I'm not sure how else
to create a date object in actionscript.
Shiny7 Guest
-
xivic #7
Re: ToScript()
Has anyone figured this out yet? I need to set the date in actionscript in a flash form. Is it even doable?
xivic Guest
-
-
xivic #9
Re: ToScript()
Shiny7, I figured out how to use the date. You need to use Date.toSring(). I
posted the complete solution here:
http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=7&thread
id=1056858&forumid=1
xivic Guest



Reply With Quote

