Flash Calling Gallery but buttons does not work in Gallery

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Flash Calling Gallery but buttons does not work in Gallery

bandersen
Hi

I am calling a Shadowbox Gallery from a Flash (swf) homepage by a button.


Button operation;
on (press) {
getURL("javascript:Gallery(2)");
}


I have added the following to my index.html file to get Shadowbox to work:

<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css"/> 
<script type="text/javascript" src="shadowbox/shadowbox.js"></script> 
Shadowbox.init({
    language: 'en',
    players:   ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
});


I have added the following function to handle the function call from the Flash page and activate the Shadowbox Gallery:

function Gallery(temp){
Shadowbox.init();
var options = {
continuous: true,
counterType: "skip"
};

var img1 = {
    player:     'img',
    content:    'Gallery/Image1.jpg',
    height:        550,
    width:        850,
    options:    options
};

var img2 = {
    player:     'img',
    content:    'Gallery/Image2.jpg',
    height:        550,
    width:        850,
    options:    options
};

var img3 = {
    player:     'img',
    content:    'Gallery/Image3.jpg',
    height:        550,
    width:        850,
    options:    options
};

Shadowbox.open([img1, img2, img3]);

};


The Shadowbox starts but the buttons are not operating correct, and IE8 gives the following error:

Message: Object doesn't support this property or method
Line: 1
Char: 1
Code: 0
URI: http://benjaminandersen.dk/shadowbox/


The page is allocated here: http://benjaminandersen.dk/shadowbox/

Do you know what is wrong ? Is Shadowbox not activated correctly ?

BR
Benjamin Andersen
Denmark
BR
Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: Flash Calling Gallery but buttons does not work in Gallery

DgAPc
well looking at the website source I see you tring to pull a image 2 different ways.  If you do it my way you want to delete
//////////////delete////////////////////////
function Gallery(temp){
Shadowbox.init();
var options = {
continuous: true,
counterType: "skip"
};
 
var img1 = {
    player:     'img',
    content:    'Gallery/Image1.jpg',
    height:        550,
    width:        850,
    options:    options
};
 
var img2 = {
    player:     'img',
    content:    'Gallery/Image2.jpg',
    height:        550,
    width:        850,
    options:    options
};
 
var img3 = {
    player:     'img',
    content:    'Gallery/Image3.jpg',
    height:        550,
    width:        850,
    options:    options
};
 
Shadowbox.open([img1, img2, img3]);
 
};
////////////////////delete//////////////////////////////

and for calling shadowbox with </@ id="carsOne" you want to add a number to the end of carsOne for each different image.

so for image 1
</@ id="carsOne1"
image 2
</@ id="carsOne2"
image 3
</@ id="carsOne3"
and you would do the same for each additional image.

You can have any name you want replaced with carsOne just remember to change that on the function call on also.
Reply | Threaded
Open this post in threaded view
|

Re: Flash Calling Gallery but buttons does not work in Gallery

DgAPc
its probly getting you the error because you don't have the added numbers.
Reply | Threaded
Open this post in threaded view
|

Re: Flash Calling Gallery but buttons does not work in Gallery

bandersen
Hi

Yes I was trying to test two different functions with two different buttons, I have added them both to page now, so it is possible to test them both.

I have added the following to the index.html: (a=@)


<@ id="carsOne1"  href="image1.jpg" rel="shadowbox[carsOneThumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"></@>
 
<@ id="carsOne2"  href="image2.jpg" rel="shadowbox[carsOneThumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"></@> 

<@ id="carsOne3"  href="image3.jpg" rel="shadowbox[carsOneThumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"></@>

Now the cars function starts but it is giving the same error as the gallery function following error : Message: Object doesn't support this property or method

Can you see what is wrong in my index.html file ?
BR
Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: Flash Calling Gallery but buttons does not work in Gallery

bandersen
Can anyone help on this subject ?
BR
Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: Flash Calling Gallery but buttons does not work in Gallery

bandersen
I finally found the solution with the help from the user: DgAPc

1. First make a button in flash and ad the following code:


on (press) {
getURL("javascript:PictureStream1(1)");
}

2. Create a new index.html file and insert the following code to call the flash file at startup on the page: (Please note start brackets are missing)

object width="800" height="600">
param name="Testpage" value="test.swf">
embed src="test.swf" width="800" height="600">
/embed>
/object>

3. Add the following just below <head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

4. Add the following just below the title:

<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css"/> 

<script type="text/javascript" src="shadowbox/shadowbox.js"></script> 
<script type="text/javascript">

5. To initiate Shadowbox add the following below (<script type="text/javascript">)

Shadowbox.init({
    language: 'en',
    players:   ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
});

6. The following function is the function that are called from flash. It is added after "5":

function PictureStream1(image) {
Shadowbox.init();
var a = document.getElementById("PictureStreamB"+image+"");
var f = new Array()
f[1] = "PictureStream1/1.jpg";
f[2] = "PictureStream1/2.jpg";
f[3] = "PictureStream1/3.jpg";
var url = f[image];
a.className = 'url';

Shadowbox.open(a);
};

7. The following are added after <body:  Please note (a=@)</b>

 

<@ id="PictureStreamB2"  href="PictureStream1/2.jpg"
title="Test2"
rel="shadowbox[PictureStream1Thumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"></@> 

<@ id="PictureStreamB3"  href="PictureStream1/2.jpg"
title="Test3"
rel="shadowbox[PictureStream1Thumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"></@> 

<@ id="PictureStreamB3"  href="PictureStream1/3.jpg"
title="Test3"
rel="shadowbox[PictureStream1Thumbs];options={counterType:'skip',continuous:true,animSequence:'sync'}"></@> 

I have added the following file as an eksample
index.html

You can add as many pictures as you want. Please send me mail if you have any problems regarding the issue. www.benjaminandersen.dk
BR
Benjamin