Topic: Embed in Flash

I'm having difficulty embedding.

My website is williamrhys.com
Under the Art section, I'd like for simpleviewer to load under that line in the middle of the page.
I'm having the most difficult time doing it.

I tried using "miker's" suggestion at the thread http://www.simpleviewer.net/forum/viewt … p?id=10032
It worked when I did it from scratch. But when I tried to replicate it on my site, I kept getting errors of:
"Line 30 - The class or interface 'Loader' could not be loaded."
"Line 56 - The class or interface 'flash.net.URLRequest' could not be loaded."
"Line 66 - The class or interface 'Event' could not be loaded."
"Line 84 - The class or interface 'Event' could not be loaded."
"Line 98 - The class or interface 'Event' could not be loaded."
"Line 102 - The class or interface 'Event' could not be loaded."

So I tried the code:

var svAPI:Object; //svAPI is the object to call API methods on
var svLoader:Loader = new Loader();
addChild(svLoader);
svLoader.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit);
svLoader.load(new URLRequest("simpleviewer.swf"));

/**
* Fired when preloader is available
* Can set gallery flashvars at this point
*/
function onViewerInit(e:Event):void{
Object(svLoader.content).addEventListener("svComplete", onGalleryLoaded);
var options:Object = Object(svLoader.content).embedOptions;
options.galleryURL = "gallery.xml";
}

/**
* Fired when gallery has completely loaded. API is now available.
*/
function onGalleryLoaded(e:Event):void{
svAPI = Object(svLoader.content).api;
svAPI.setSize(640,480);
}

And got the errors:
"Line 2 - The class or interface 'Loader' could not be loaded."
"Line 11 - The class or interface 'Event' could not be loaded."
"Line 20 - The class or interface 'Event' could not be loaded."

/is so confused

Re: Embed in Flash

Do you have the following at the top of your doc?

//import required classes
import flash.display.*;
import flash.net.URLRequest;
Mike Richards
SimpleViewer Support Team.

Re: Embed in Flash

Yes, on both examples it started with that...

miker wrote:

Do you have the following at the top of your doc?

//import required classes
import flash.display.*;
import flash.net.URLRequest;

Re: Embed in Flash

Ok, you just didn't include it in the post. The flash your are loading SimpleViewer 2 into is it AS3?

Mike Richards
SimpleViewer Support Team.

Re: Embed in Flash

Im using AS2 and CS4

Last edited by wrmr3d (2010-03-14 00:22:59)

Re: Embed in Flash

Embedding SimpleViewer-Pro in Flash requires the embedding movie to be ActionScript 3 and requires Adobe Flash CS3 (or later) authoring software. Embedding SimpleViewer-Pro in Flash requires a basic level of Flash authoring experience.

Felix Turner
SimpleViewer Support Team.