Skip to main content
Inspiring
August 27, 2007
Question

Is there wMode in cfchart with flash?

  • August 27, 2007
  • 2 replies
  • 1345 views
Pretty simple, I have a menu in javascript that is hidden behind a large cfchart. If this was standard flash you can set the wMode="transparent" and that usually takes care of it. Can this be done in cf7? Thanks!
    This topic has been closed for replies.

    2 replies

    Inspiring
    February 26, 2009
    Well done guys, but I think there's a less *hack* technique (sorry, i'm french ...).

    If you use the "name" attribute of the CFChart tag, you can create easyly the swf file you want to display.
    Then, it will be available in memory an you can write it to a file usign Cffile Tag.
    Finaly, you will just have to put it in your page using object/embed/script within you can specify wmode parameter.

    !WARNING!
    Scenario 1 :
    In my case, the graph comes form back-end defined values.
    I will generate the swf file only when data are updated.
    So the CFChart is only used in back-end (will save a lot of server-side consumption).
    BUT
    Scenario 2 :
    If you do so "as-is" each time the page is displayed front-end , you may encounter problems with file integrity (all your users are not synchronized ... some may not see the swf while others re-generate it). So you have to customize this a bit to get rid of it.

    Some sample code bellow for a better comprehension.
    That's it for now, have a good coding session ! :)

    N.B : Raymond Camden is the father of all of this, here : Embedded CFCHART in Flash Forms. thanks should be sent to him !!!
    digicidal
    Participant
    January 5, 2008
    I've seen postings from you on several sites looking for this - and considering the age of this posting I assume that you may have found your answer on your own, however in case you did not I found a relatively simple 'hack' that will allow you to make this change on a dynamic flash output from cfchart that I thought I'd share. Since there are many of us that use DHTML menus on our apps/sites this is not too uncommon. Hopefully this will make it in to a later version (since I didn't see it in scorpio either, but haven't really researched it since I'm on CF7 as well for my production server).

    This is not really applicable in cases where the output is saved to a file and then statically placed... it's easy to set the wMode in that case... just put it in. But if you are simply using <cfchart> to create the output then I've used the following solution.

    First wrap the entire <cfchart> code to a variable with <cfsavecontent> so that the output is there (I also use this to make all flash chart output SSL compatible by replacing all 'http:' with 'https:'). Then place the following two lines immediately before the output of the variable used to save the content:

    <cfset chartoutput=replacenocase(chartoutput,'quality="high"', 'quality="high" wmode="transparent"', "ALL")>
    <cfset chartoutput=replacenocase(chartoutput,'<PARAM NAME="quality" VALUE="high"/>', '<PARAM NAME="quality" VALUE="high"/><PARAM NAME="wmode" VALUE="transparent"/>', "ALL")>

    once that is done you can simply place the flash chart wherever you need it with <cfoutput>#chartoutput#</cfoutput>

    This may not work forever, but it will work with CFMX 6.1 and 7 - i've had success with both. Also this may not work with all DHTML - that depends largely on how your code is written and what the existing z-index values are of the elements on your page.

    Hope this helps someone - it was a real trial for me to find an answer to this problem, so I had to create my own. Maybe this will save someone else the trouble.

    Participant
    May 5, 2008
    This is an excellent hack digi... bravo!

    Not only does it solve the transparency bug with CFCHART's "backgroundColor" and "dataBackgroundColor" (you know, the 8-digit hex value that adobe livedocs says sets both RGB & transparency, but doesn't and never has), but it also solves the problem of flash-formatted CFCHART's having an infinite z-index (a bug reported 5 years ago as of this writing) which essentially overrides the z-index of any container it may be sitting in. By using your method, the CFOUTPUT of the saved variable goes back to obeying the z-index of its container DIV, thus allowing me to move other flash objects on top of the flash-based chart.

    Kudos & Thanks!
    -Michael