These forums are provided for community interactions only. For official support please submit a support ticket.
You are not logged in.
I just wanted to use thumbgrid seperately without interfacing with SSP. Is this possible?
Also the thumbnails can have a "link" tag associated with it? To link to an external url?
Offline
ThumbGrid can currently only work in conjunction with SlideShowPro for Flash. You can always have the SlideShowPro instance outside of the stage so you only see the ThumbGrid.
Clicking on an image in ThumbGrid currently only loads the corresponding image on the SlideShowPro for Flash instance, there is no way to change this behavior, but you can code this in externally by using some ActionScript and the currentThumb event from the ThumbGrid API.
http://wiki.slideshowpro.net/TG/API-currentThumb
Offline
afrmx wrote:
ThumbGrid can currently only work in conjunction with SlideShowPro for Flash. You can always have the SlideShowPro instance outside of the stage so you only see the ThumbGrid.
Clicking on an image in ThumbGrid currently only loads the corresponding image on the SlideShowPro for Flash instance, there is no way to change this behavior, but you can code this in externally by using some ActionScript and the currentThumb event from the ThumbGrid API.
http://wiki.slideshowpro.net/TG/API-currentThumb
How can I "navigateToURL" using this code?
import net.slideshowpro.thumbgrid.*;
my_tg.addEventListener(TGThumbEvent.CURRENT_THUMB, onThumbEvent);
function onThumbEvent(event: TGThumbEvent) {
if (event.type=="currentThumb") {
trace(event.data.link);
}
}
my_tg.addEventListener(TGThumbEvent.CURRENT_THUMB, onThumbEvent);
Offline
Just use the event.data.link value and assign it to the navigateToURL function of flash.
Offline
I think I tried that, do you have an example?
Offline
You can hide SlideproShow by setting alpha = 0 or by setting dimension to 0.
So even though they are being used together, you would get the benefit of seeing only the grid.
Offline
I'd be extremely interested if anyone figured this out. How can I assign the link value to the navigateToURL function?
Offline
So, after digging around on some other topics on this board, I think I've come closer.
I get the general logic, I want to get the link from the XML file, format it so it can be read as a URL, then use navigateToURL
However, I'm just not quite there yet.
Here's the code.
var page
var url:URLRequest = new URLRequest(page);
function onThumbEvent(event: TGThumbEvent) {
if (event.type=="currentThumb") {
trace(event.data.link);
url=event.data.link;
}
}
my_tg.addEventListener(TGThumbEvent.CURRENT_THUMB, onThumbEvent);
function onRequestEvent(event:TGRequestEvent) {
navigateToURL(url,"_blank");
}
my_tg.addEventListener(TGRequestEvent.LOAD_THUMB, onRequestEvent);It brings back 2 errors:
TypeError: Error #1034: Type Coercion failed: cannot convert "http://mysite.com/folder/index.html" to flash.net.URLRequest.
TypeError: Error #2007: Parameter url must be non-null.
I have checked the link in the XML file, and it works fine on its own. All help is greatly appreciated.
thanks!
Offline
Well, I found a solution, so I thought I'd share with everyone. This makes use of the clickThumb event, so you'll need version 1.2.4 or higher
var page
function onLinkEvent(event:TGThumbEvent) {
if (event.type=="clickThumb") {
page = new URLRequest (event.data.link);
navigateToURL(page, "_blank");
}
}
my_tg.addEventListener(TGThumbEvent.CLICK_THUMB, onLinkEvent);This will open up the link that's defined in the link property of the XML file...
Offline
Thanks for sharing. I too am interesting in doing the same thing!
Offline
I'd like to be able to use the ThumbGrid on its own as discussed here and when I click on one of the thumbnail images, have it open the corresponding image in SSP inside a pop-up window using one of the new JS libraries such as FancyZoom.
Not being familiar with Flash (where to put the above code examples?), I'm not sure if this is possible using ptlx's example. Can anyone advise?
I'd settle for clicking on any of the thumbs in the ThumbGrid to be able to load the slideshow externally...
TIA
Last edited by britSlide (2009-07-17 16:17:22)
Offline
Would you please tell me where to put this?
Do you put it in a keyframe in actions on the timeline? or does it need a separate file.
ptlx wrote:
Well, I found a solution, so I thought I'd share with everyone. This makes use of the clickThumb event, so you'll need version 1.2.4 or higher
Code:
var page function onLinkEvent(event:TGThumbEvent) { if (event.type=="clickThumb") { page = new URLRequest (event.data.link); navigateToURL(page, "_blank"); } } my_tg.addEventListener(TGThumbEvent.CLICK_THUMB, onLinkEvent);This will open up the link that's defined in the link property of the XML file...
Offline
for this, i put it in a keyframe on the timeline
Last edited by ptlx (2009-07-21 00:23:21)
Offline
thanks... that is what i did and it didn't work for some reason...
Offline
Here is a block of code that takes what catmeier08 posted and adds a hand cursor, makes the requested page open in the same window and imports the required classes. Put this code in the root timeline on frame 1 (make a new layer called "actions", lock it and put this code on frame 1). Then just fill out the link in the xml document.
import net.slideshowpro.thumbgrid.*;
var page
function onLinkEvent(event:TGThumbEvent) {
if (event.type=="clickThumb") {
page = new URLRequest (event.data.link);
navigateToURL(page, "_self");
}
}
my_tg.addEventListener(TGThumbEvent.CLICK_THUMB, onLinkEvent);
my_tg.buttonMode=true;Offline
Hey, thanks alot! I got it to work. Yea!
Offline
Thank You!
Offline
Hi all,
New to all of this and am wondering can I use thumbgrid to nav round my site.?
I can see how to hide Slideshow but would like to know how to set a value to a Thumbgrid that on clicking will open another webpage.
Anyone able to help?
Many thanks.
Offline
Excuse a basic question but where do you define the link in the XML file?
ptlx wrote:
Well, I found a solution, so I thought I'd share with everyone. This makes use of the clickThumb event, so you'll need version 1.2.4 or higher
Code:
var page function onLinkEvent(event:TGThumbEvent) { if (event.type=="clickThumb") { page = new URLRequest (event.data.link); navigateToURL(page, "_blank"); } } my_tg.addEventListener(TGThumbEvent.CLICK_THUMB, onLinkEvent);This will open up the link that's defined in the link property of the XML file...
Thanks for any direction.
Offline
thisey wrote:
Excuse a basic question but where do you define the link in the XML file?
Thanks for any direction.
Offline
Thanks for the great code guys,
Here is the AS3 version:
import net.slideshowpro.thumbgrid.*;
function onLinkEvent(event: TGThumbEvent) {
if (event.type=="clickThumb") {
var req1:URLRequest=new URLRequest(event.data.link);
navigateToURL(req1,"_parent");
}
}
my_tg.addEventListener(TGThumbEvent.CLICK_THUMB, onLinkEvent);Offline
Awesome, I might be able to use thumbgrid for "gallery" effect this way.
Offline
I'm trying to use ThumbGrid to launch hyperlinks directly as discussed here but am having no success. I've given my instance of ThumbGrid the correct name (my_tg) and copied and pasted the code above but when I publish it still doesn't work.
Could there something simple I've missed, maybe a parameter in either of the components?
Any help would be greatly appreciated as I'm at a total loss!
Offline
Thanks everyone,
Using all of the comments here I was able to use my thumb grid as a title panel and call individual named frames in Flash that contained each gallery.
Here are the quick steps:
1) Have your thumb grid linked to a SSP component. Set all instance names
2) Make sure SSP component is set to a size of: 0,0, and turn the Startup to: Load album and wait,
Here: is the code I used(mostly a combination of everyones comments)
stop();
import net.slideshowpro.thumbgrid.*;
function onThumbEvent(event:TGThumbEvent) {
//trace("Current thumbnail: " + event.num + " Is first? " + event.isFirst + " Is last? " + event.isLast);
if(event.num == 0){
gotoAndStop("Frame_Name");
}
}
Home_TG.addEventListener(TGThumbEvent.CURRENT_THUMB, onThumbEvent);
Hope this helps anyone else looking for an answer. My next step is to work with a switch statement as opposed to if statements.
Offline
Hi everyone (I GOT THE SOLUTION),
I figured out how to make this work for everyone out there struggling. It appears that when you embed your flash file, you'll need to ensure that you use the allowScriptAccess='always' to get this to work. The code from before works great in flash, but not on a published webpage b/c of security reasons with the flash file wanting to "only" let you go to a link from a webpage on the same server as your .swf file. The options for "allowScriptAccess" are "always", "sameDomain" and "never". You want to use the "always" to get this to work.
So here are the steps (this s from my code that works fine from any domain using code from the previous post):
STEP 1: Place this in action script in Flash for your ThumbGrid (same as previous post):
import net.slideshowpro.thumbgrid.*;
var page
function onLinkEvent(event:TGThumbEvent) {
if (event.type=="clickThumb") {
page = new URLRequest (event.data.link);
navigateToURL(page, "_self");
}
}
my_thmb.addEventListener(TGThumbEvent.CLICK_THUMB, onLinkEvent);
my_thmb.buttonMode=true;
STEP 2: Embed your .swf on your webpage using the following:
<param name="allowScriptAccess" value="always" />
Do this however you embed. Director code may look like:
<script type="text/javascript">
var flashvars = {}
var params = {
allowfullscreen: "true",
allowScriptAccess: "always"
}
var attributes = {}
swfobject.embedSWF("http://www.domain.com/thumbgridfile.swf", "flashcontent", "930", "215", "9.0.0", false, flashvars, params,
attributes);
</script>
OR SOMETHING LIKE
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="930" height="215" id="thumbgridfile" align="middle">
<param name="allowFullScreen" value="false" />
<param name="allowScriptAccess" value="always" />
<param name="movie" value="http://www.domain.com/thumbgridfile.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="http://www.domain.com/thumbgridfile.swf" quality="high" bgcolor="#ffffff" width="930" height="215" name="thumbgridfile" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
Hope this helps everyone finally. I'm not one to do posts, but I figured after researching for a hours myself, I wanted to contribute back.
-Brian
Offline