+ Start a Discussion
Vivek ManchandaVivek Manchanda 

How to call "Flex" (.swf File) Flie in Visual Force Page??

   Hi All

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
Ron HessRon Hess
something like this
 

    <apex:flash src="{!$Resource.MVCFlex}" height="200" width="600" id="MVCFlex"
 flashVars="requestData=getData" />




you will then add flashvars for sessionID and serverURL so that your flex component can call back to the server.
Vivek ManchandaVivek Manchanda
Thanks

But we can also use the html <body> of S-Controls in are VF page and then we can also display the Flex Application I have tried it and it works .

Thanks

Vivek Manchanda
SLMSLM
Hi
 
I am new to Salesforce. I want to know the steps how to call flex swf file in VisualForce. could u please send me the whole code 
MohanaGopalMohanaGopal

Hi..

 

1.Create .swf file

2. Store it in Static Resource (Appsetup -> Develop -> Static Resources) Name - MVCFlex

3.In ur VF page add the following code where u need..

 <apex:flash src="{!$Resource.MVCFlex}" height="200" width="600" id="MVCFlex" />

SLMSLM
Thank you very much...
 
 
 
One more query....
 
If we can pass any value from this swf file to VF page. or any value from VF page to SWF file.
 
 
Vivek Need helpVivek Need help
Hi

Yes you can pass the values from VF page to the Flex .swf file .
flashvars="session_id={!$API.Session_ID}&server_url={!$API.Partner_Server_URL_100}&AccountId={!AccountId } " 

Thanks
Vivek Manchanda

SLMSLM
Thanks,
 
But where to write this line in VF or flex, and how
 
 
Vivek Need helpVivek Need help
Hi

You need to right this line in VF pages

<apex:flash src="{!$Resource.MVCFlex}" flashvars="session_id={!$API.Session_ID}&server_url={!$API.Partner_Server_URL_100}&AccountId={!AccountId } "  height="200" width="600" id="MVCFlex" />

This is the way to call Flex Application  through Static Resource in VF Page

Thanks
Vivek Manchanda
SLMSLM

Thanks,

But the Account id i am passing from VF, how i can take into Flex. In flex also i need to explicitely write some line to get that value. could you please help me on that.

 

MohanaGopalMohanaGopal

Hi..

 

apex.query("select Id,Name from Account  where Id='"+Application.application.parameters.Accountid+"'",
new AsyncResponder(.....

 

For more details check out Flex help in Flexbuilder

Vivek Need helpVivek Need help
Hello

var accountId:String

accountId:this.parameters.AccountId

This is the way to get the values in Flex

Thanks
Vivek Manchanda