SalesForce VisualForce and Flash

Every so often I am asked whether or not I can put a SWF onto a VisualForce web page in SalesForce.

As it turns-out, I do know how to do this.

The last time I was asked I said Flash SWFs can be plugged into a VisualForce web page as easily as any image could be and this has proven to be true, as if there was any doubt.

Step #1:

Get yourself a SalesForce account or get yourself a Free Developer’s account from SalesForce.com

Step #2:

Create your VisualForce page as shown below.

Here we can see how to create a visualforce page using 3 easy mouse clicks.

Step #3:

Populate the visualforce page with the content required to embed a swf.  Don’t bother hot-linking to the SWF shown in this example the result will not be what you may expect unless you want to send visitors to the site that owns that SWF.

That’s all there is where the visualforce page is concerned.

Step #4:

Now let’s make a site, cannot expose a visualforce page to the outside world unless there is a site.

Again just 3 easy mouse clicks with some information entered when required and you have your site.

Step #5:

Now you need to get your visualforce page associated with your site.

And then…

And then…

And then…

Conclusion:

Anyone who has evern embedded a SWF onto any kind of web page can embed a SWF into a visualforce web page.

Notice the SWF is not being served from SalesForce but it is being served from a CDN (Content Delivery Network) and this is the preferred method.

You could upload your SWF as a static resource as shown below:

But let’s face it, I would rather have more control over my static resources than this allows but that’s just me to be sure.

Either way, this is all easy stuff.

I will say the Flash support via Apex is rather limited but one can always craft some JavaScript to handle the embedding of a SWF and call it a day.

The page with the SWF can be seen via http://raychorn-developer-edition.na6.force.com/test.

Advertisements

About Ray C Horn
See my profile at http://www.linkedin.com/in/raychorn with more than 1286+ connections and growing all the time.

Comments are closed.

%d bloggers like this: