Professional Web Applications Themes

CF pass variables to Flash - Coldfusion Flash Integration

Hello: Basically I want Coldfusion to pass the server date to Flash. But I get '#theDt#' instead of the value of 'theDt' please see the code below: Thank you in advance. ************************************************ theDate.cfm <cfsetting enableCFoutputOnly="Yes"> <cfset theDt = dateFormat(now(), 'mm-dd-yyyy')> <cfoutput> &serverDate=#theDt# </cfoutput> ************************************************** *************** var my_lv:LoadVars = new LoadVars(); my_lv.onLoad = function(success:Boolean) { if(success) { theDate.text = my_lv.serverDate; //theDate.text = this['serverDate']; //theDate.text = this.serverDate; } else { var localDate:Date = new Date(); theDate.text = (localDate.getMonth()+1)+"/"+localDate.getDate()+"/"+localDate.getFullYear(); } } my_lv.load("C:\CFusionMX7\wwwroot\OC\theDate.c fm"); ************************************************** *************...

  1. #1

    Default CF pass variables to Flash

    Hello:

    Basically I want Coldfusion to pass the server date to Flash. But I get
    '#theDt#' instead of the value of 'theDt' please see the code below:

    Thank you in advance.

    ************************************************
    theDate.cfm

    <cfsetting enableCFoutputOnly="Yes">
    <cfset theDt = dateFormat(now(), 'mm-dd-yyyy')>
    <cfoutput>
    &serverDate=#theDt#
    </cfoutput>
    ************************************************** ***************

    var my_lv:LoadVars = new LoadVars();
    my_lv.onLoad = function(success:Boolean) {
    if(success) {
    theDate.text = my_lv.serverDate;
    //theDate.text = this['serverDate'];
    //theDate.text = this.serverDate;
    } else {
    var localDate:Date = new Date();
    theDate.text =
    (localDate.getMonth()+1)+"/"+localDate.getDate()+"/"+localDate.getFullYear();
    }
    }
    my_lv.load("C:\\CFusionMX7\\wwwroot\\OC\\theDate.c fm");
    ************************************************** *************

    lvbao Guest

  2. #2

    Default Re: CF pass variables to Flash

    I think it doesn't work because the flash variable serverDate is not known to Coldfusion and the Coldfusion variable serverDate is not known to Flash.


    BKBK Guest

  3. #3

    Default Re: CF pass variables to Flash

    my_lv.load("C:\\CFusionMX7\\wwwroot\\OC\\theDate.c fm");

    You are not "executing" a CF page, just reading the content.

    The route should be something like (if you are testing in your machine) :
    my_lv.load("http://127.0.0.1//OC//theDate.cfm"); or the URL corresponding (and
    the webserver must be configured to execute CF pages)

    Regards

    Sojovi Guest

  4. #4

    Default Re: CF pass variables to Flash

    Solved it? If not, think of [url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000654.htm[/url]
    BKBK Guest

  5. #5

    Default Re: CF pass variables to Flash

    Yep, it works. Thank you Sojovi, BKBK for your answer.
    lvbao Guest

Similar Threads

  1. trying to pass two variables to a detail page??
    By AS Dawg in forum Dreamweaver AppDev
    Replies: 1
    Last Post: April 7th, 07:39 PM
  2. Insert Record and pass url variables
    By brianevans5179 in forum Dreamweaver AppDev
    Replies: 6
    Last Post: March 30th, 01:46 PM
  3. Interesting Pass Variables to Flash
    By DefaultDave in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 17th, 09:49 PM
  4. pass variables when execute a Dir movie
    By cobian webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 1
    Last Post: December 8th, 12:25 PM
  5. Can one pass variables through a selector?
    By Andrew Hunter in forum Mac Programming
    Replies: 5
    Last Post: September 10th, 03:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139