+ Start a Discussion
ImaghrooriImaghroori 

Visual Force S-Control with Attached Flex file.

Hello,

I am currently using a home brewed S-control.  This S-control is a flex chart that I have created.  I used the tutorial on here to learn how to call the attached .swf file in the s-control. 

However, when calling it in visualforce, it does not work. 
Can anyone give me an example of how they would do this?

Thank you.
DevAngelDevAngel
Hi Imaghroori, There is a slight difference between s-controls and visualforce with regards to the merge fields that you use to initialize the swf file. Check the flashvars parameter of the embed or object tag that you are using for the swf.  For an s-control it usually looks like:

flashvars="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_80}"  

But for Visualforce pages it should look like:

flashvars="session_id={!$API.Session_ID}&server_url={!$API.Partner_Server_URL_80}"

Notice the inclusion of the dollar sign ($) for Visualforce. Cheers

Message Edited by DevAngel on 09-20-2007 02:37 PM

Vivek ManchandaVivek Manchanda
Hi

I have created a Flex based Application which contain some Salesforce Information .

Now I need to display that Flex Application in VF Page .

I can create an S-Controls form Flex File but I don't know How to Call the Flex File(.swf File) in VF Page .

One way which I know is by making Static Resources of that .swf File and then and then call that file in VF page . but in this case I was not able to login in Salesforce through my Flex Application (.swf File).
 
Any one can advice me how to do that .

Thanks
Vivek Manchanda
dchasmandchasman
NOTE: The $API syntax is also available in scontrols (has been for a few years now)