Topic: Embedding in Flash (have tried MikeR's code, not working)

Hi!  So I'm trying to embed my player, which I've customized, into my existing flash site (built in Flash CS4, but using Actionscript 2.0)

I just tried using the code I saw earlier on the forum. On a layer with other objects, I placed a rectangle, converted it to a movie clip, then on that layer, I used this code that miker had given to someone else.

 var myMovieClipLoader = new MovieClipLoader();
myMovieClipLoader.addListener(this); 

function loadGallery(){

_root.xmlDataPath = "gallery.xml";
myMovieClipLoader.loadClip("viewer.swf",nameOfTheEmptyClip); 

}

loadGallery(); 

In return, when I test the .swf, I get 6 compiler errors - 4 being  "Unexpected '#' encountered" and then also "unexpected (" and "unexpected &".

Any help out there?  Phew, I never thought embedding a .swf would be this hard!

Re: Embedding in Flash (have tried MikeR's code, not working)

Have you taken a look at the flash embedded example that comes with the pro download?

Mike Richards
SimpleViewer Support Team.

Re: Embedding in Flash (have tried MikeR's code, not working)

Yes sir.  I was a little confused by the fact that it was for multiple galleries, as I only want ONE gallery to appear on my site. Is there a portion of the code that I should be using just for one gallery?  I attempted to modify the code for just one gallery by deleting the code for the gallery2, but that didn't seem to work either.

Re: Embedding in Flash (have tried MikeR's code, not working)

I also didn't know if I needed the mcGal buttons to use that code.

Is it possible to just have the SimpleViewer gallery load when the viewer clicks the navigation button I have designated to gotoandStop on my "portfolio" page?

Re: Embedding in Flash (have tried MikeR's code, not working)

and you replace nameOfTheEmptyClip with the instance name of your empty clip?

var myMovieClipLoader = new MovieClipLoader();
myMovieClipLoader.addListener(this); 

function loadGallery(){
    _root.xmlDataPath = "gallery.xml";
    myMovieClipLoader.loadClip("viewer.swf",nameOfTheEmptyClip); 
}

loadGallery();
Mike Richards
SimpleViewer Support Team.

Re: Embedding in Flash (have tried MikeR's code, not working)

Mike,

I just figured it out!  I hadn't had my stage in the code set at the same size as the mcLoader.  It's working beautifully now. Thanks for your help!

Re: Embedding in Flash (have tried MikeR's code, not working)

Mike,

I just figured it out!  I hadn't had my stage in the code set at the same size as the mcLoader.  It's working beautifully now. Thanks for your help!


can you tell us what the complete code is that you are using now? I'm having trouble getting the viewer.swf into my flash frame. the code i have is:"

_global.SVStageWidth = 630;
_global.SVStageHeight = 520;

var myMovieClipLoader = new MovieClipLoader();
myMovieClipLoader.addListener(this); 

function loadGallery1(){
    _root.xmlDataPath = "./mtr/gallery1/gallery.xml";
    myMovieClipLoader.loadClip("./mtr/gallery1/viewer.swf",container_mc); 
}

loadGallery1();

This code does not load de viewer into my container_mc?
Anyone any ideas?

Wessie

Last edited by wessiez (2009-12-06 17:29:19)

Re: Embedding in Flash (have tried MikeR's code, not working)

Are you sure ./ is the right format for "./mtr/gallery1/viewer.swf"? I would try ../ or a absolute URL.

Mike Richards
SimpleViewer Support Team.

Re: Embedding in Flash (have tried MikeR's code, not working)

The ./ does work. When you put an ../ its goes to the first map where my index file was placed.
But I've got a solution:

I had my "menu" in frame 1, and the gallery's in frame 2, 3, 4, and 5. In the gallery frames i created a back button with the action [gotoandplay(1)] but that worked only for the first gallery. When I clivked another gallery the viewer stopt loading at the first thumb.

Now I've placed an action on the actionbutton getURL("javascript:mainGallery()"); with load the main "menu" back and the gallery's are empty.

Thanks for the reply!