SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

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

SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

s2s


Hi All!

Does anyone know how to launch a shadowbox gallery (image, flv, mov or mixed) from a flash button?

I know how to launch a single image, single flv and single mov, but I can't for the life of me figure out how to launch a gallery!

Any help would be appreciated.

Cheerio,

S
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

ninja9
bumping this....
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

Wizzud
In reply to this post by s2s
As in the documented examples (see Script-triggered Gallery example), Shadowbox.open() will accept an array of suitably constructed objects and treat them as a gallery.
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

ninja9
i cant seem to work this out on my own, would it be possible for someone to write an example of a gallery being opened from a flash button using the 'geturl' command?
thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

Wizzud
Where are your images? In the Flash movie and/or on the HTML page?
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

ninja9
the flash is calling the images from the root of the websites directory, not in flash, although the images could be added to the flash if it is more convenient...
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

ninja9
...to clarify, the thumbnails are on the flash movie, and the thumbnails call shadowbox which opens the images from the websites root directory...
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

Wizzud
Right ...
- you have one (or more) "set(s)" of thumbnails inside a Flash movie, and only that Flash movie knows about the big image (or group thereof) that might be displayed as a resulting of clicking on one of those thumbnails
- the parent HTML page currently has absolutely no clue as to what constitutes a "gallery", or what the Flash movie wants to do when some unknown thumbnail image is clicked on

You have 3 choices :
a. for each and every click, the Flash movie informs the parent page of the entire gallery contents required to be shown in Shadowbox (starting with the item corresponding to the clicked-on thumbnail).
b. you set up the parent page so that it already knows what constitutes any "gallery", and the Flash is then only required to inform it of which particular "gallery" item to open (as a result of clicking on a thumbnail).
c. the Flash movie (in conjunction with script on the parent page) creates the relevant links on the parent page for each "gallery" item that it might possibly need to display in Shadowbox, then requests the parent page to initialise Shadowbox, then simply informs the parent page of which of those links to open when a corresponding thumbnail (within Flash) is click on.

Shadowbox is not omniscient. It can only show items that it already knows about, or that it is explicitly told to.
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

ninja9
yeah, i understand all of that, however i am still having trouble with it..to clarify again...

on (release) {getURL("javascript:openShadowbox('image.jpg', 'img', 'title');");}

^^this is what im using at the moment to open a signe image, rather than the gallery i wish to open from flash

this is the HTML i want to translate to the flash button....

[a rel="shadowbox[gallery];options={counterType:'skip',continuous:true,animSequence:'sync'}"
href="image.jpg"><alt="image"]

what i need to know is how to do this using the flash geturl feature... sorry if i seem a little ignorant, i greatly appreciate all your help so far
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

Wizzud
At the risk of repeating myself (and according to what you have said) ...

Your Flash movie :  this, and only this, knows what images constitute a "gallery"
Your HTML page :  this has no clue what images constitute a "gallery"!

Your getURL instruction is currently calling a piece of script on the HTML page which is designed to open a single, specified image that it is only told about at the instant that it is called.

You are not trying to replicate just ...

[a rel="shadowbox[gallery];options={counterType:'skip',continuous:true,animSequence:'sync'}"
href="image.jpg"><alt="image"]

... but really ...

[a rel="shadowbox[gallery];options={counterType:'skip',continuous:true,animSequence:'sync'}"
href="image.jpg"><alt="image"][a rel="shadowbox[gallery];options={counterType:'skip',continuous:true,animSequence:'sync'}"
href="image2.jpg"><alt="image"][a rel="shadowbox[gallery];options={counterType:'skip',continuous:true,animSequence:'sync'}"
href="image3.jpg"><alt="image"][a rel="shadowbox[gallery];options={counterType:'skip',continuous:true,animSequence:'sync'}"
href="image4.jpg"><alt="image"]
....etc, etc

Since your HTML page does not actually <i>have any of the above HTML on it, your Flash movie needs to provide all the above the information. It can either do this as a sort of initialisation, or it can do it on each instance of a "button" being clicked. Either way, the communication method between Flash and HTML page is getURL() (or equivalent) to an appropriately constructed javascript function.

Of the 2, I think initialisation is neater (my opinion) and provides more consistent results:

initialise from Flash...
- getURL(image info) -> javascript function(image info) : creates hidden shadowbox link on page
- repeat the above for all images, specifying gallery as part of the image info
- getURL() -> javascript function() : runs Shadowbox.init()
on clicking in Flash...
- getURL(which image) - > javascript function(which image) : runs Shadowbox.open() on the required image

Without initialisation :
HTML page...
- javascript function : runs Shadowbox.init()
on clicking in Flash...
- getURL(all images that form the gallery) - > javascript function(all image info) : run Shadowbox.open() on an array of images designated as being a "gallery"

[ The trouble with not initialising is that if the Flash movie provides the option to click on any thumbnail of a "gallery", the clicked-on image has to be the first image passed through to the javascript function otherwise if won't be the first one seen when Shadowbox opens the gallery; which means that the gallery order depends on which thumbnail is clicked! ]

The third option is simply to put all your images onto the HTML page (as hidden shadowbox links) to start with, and just get the Flash movie to tell the javascript on the HTML page which one to open.

All of the above tells you how to go about doing what you want - in 3 different flavours! - but it does not provide what I think you are really after ... which is a copy-paste solution, from which you would learn nothing, and about which I would get no end of queries and requests for changes! I don't work with Flash, and therefore cannot test any solution I might care to post - so I don't intend to. I will help with javascript where I can, but it usually requires some attempt to have been made to understand what is required and how to go about it.

Here endeth today's lesson.

(I have a streaming cold, a sore throat, didn't get much sleep last night, and am generally not in a good mood. If this comes across in any of the above, then I apologise!)

Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

ninja9
i know i must be trying your patience by now and i do apologize, but i understand exactly what im trying to do, and understand how it is meant to be done, im just having trouble actually getting my solution into code, ive tried endless combinations of what i think would work to no avail, i know its against your code of practice to give cut and paste solutions but is there any hope in hell you could write anything..an outline even of the geturl function that would open a gallery, ive tried myself for a good few hours every day now with no luck.
apologies again for bugging you :/
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

susieQ
ninja, nice post - 'i know what i want etc i just want you to do it all for me...'

i think wizzud has given you enough to be getting on with, good luck
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

haterade
if you are not a coder then no wizzud did not help in essence (no offense wizzud you are very knowledgeable). not everyone is a coder. thats the main reason people are here PLEADING for help!!  I am having the same problem and i feel bad for not being able to do something that just makes complete and utter sense to want to do. If someone asks for help and i know they are not coders, i dont sit back and laugh as they clammer to understand something that is truely not understandable. Its like throwing a baby into a triathlon and expecting it to make it to the finish line.
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

build
Ninja,
I have read this thread and if the reader can't write the code from the information provided then they should not be producing web pages until they have advanced their skill set.

I think what you're saying is that Wizzud should write the code for you? He is a busy bloke, if you want a professional to do it for you there are many available. If you want to do it your self head to w3schools:
http://www.w3schools.com/default.asp
they will teach you how.

If you try and have problems then post back with a link to an example of what you have done. I'm sure Wizz and certainly I will try to assist you. I hope this helps.

Warm Regards,
build
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

neocorps
In reply to this post by ninja9
Hey ninja9,

 I was in the same position that you where a few months ago, and i understand that you like many other people found out about this application, and liked it, and if you want to use it, it doesn't mean that you will devote your precious time to learning other language "JavaScript", your fortitude might be design, or php programing, or databases, who cares, the only thing that cares is that you are asking for help with something that you don't fully understand, and mate, if u managed to make the image work from flash, means that at least you are trying.

 I don't really care for people who gives you tips for a solution if they see that you are trying to make it work and still get no solution.

 A year ago i didn't know how to make a web page, and now i have my own business doing that, and if i don't understand something i ask in forums like this one, and sometimes i copy paste a solution, but that doesn't mean that i don't learn how to use it, in fact its the other way, because with the solution you can analyze it, understand it, and further increase your knowledge by upgrading the solution.

 If i have time i will help people like you, just like someone else helped me, and if i have time to write this, you are damn right i got time to tell you a solution or at least investigate and give you an answer!

 Here is a link i found of a guy that did what you want to do:

Flash triggered gallery

 And here is an other link of a guy that managed to trigger a gallery done in a different way:

Flash triggered gallery 2

I hope this works for you and if you can't make it work, please post again and I'll help you in my free time.
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

Shad
Thank you, thats help me very much !!
Reply | Threaded
Open this post in threaded view
|

Re: SHADOWBOX GALLERY FROM SINGLE FLASH BUTTON

Shad
Maybe its too late, but this can be useful for someone else...
How to open dynamic gallery from Flash to Shadowbox ::

Flash AS3 ::
----------------
var formatedArrayToJavascript:String = "[['img','image 1','image.jpg',250,250],['img','image 1','image.jpg',250,250]]";
var url:URLRequest = new URLRequest("javascript:gallery("+formatedArrayToJavascript+")");
navigateToURL(url, "_self");

Javascript ::
----------------
function gallery(pPreview){    
   
        var aPreview = new Array();
        for (var i=0; i<pPreview.length; i++)
        {
                var preview = {
                player:     pPreview[i][0],
                title:      pPreview[i][1],
                content:    pPreview[i][2] ,
                width: pPreview[i][3],
                height: pPreview[i][4]
           };
                aPreview.push(preview);
        }

    Shadowbox.open(aPreview, {
        continuous: true
    });

};

Hope this will help someone !