as3 xml lightwindow!
- Started
- Last post
- 10 Responses
- wwfc
can anyone tell me how make this html link
<a href="gallery/spider-man3-trl3.mov" class="lightwindow page-options" params="lightwindow_width=640,lightwindow_height=320" >Quicktime Movie Example - 20MB Local File!</a>work as a link from my xml item:
<thumbnail filename="flashmo_096_3d_cylinder_box.jpg" url="http://images.apple.com/movies/dreamworks/transformers/transformers-tlr4_h.640.mov" class="lightwindow page-options" params="lightwindow_width=640,lightwindow_height=288" target="_blank" title="Item No. 1 (096 3d cylinder box)" description="more than meets the eye" />to fire a lightbox overlay in the html doc - the current xml is brought into the as3 swf - and opens the new window on click.
this is the as that works the click
function p_click(me:MouseEvent)
{
var sp:Sprite = me.target as Sprite;
var s_no:Number = parseInt(sp.name.slice(8,10));
navigateToURL(new URLRequest(url_list[s_no]), url_target_list[s_no]);
}do i need to change the xml? or do i need to change the as3 function - or do i need to be looking into the main html?
http://www.pastebin.se/196993that includes all of the links/formats that 'do' open the lightbox function.
anyone tell me how i can the links to open in the lightbox via as3/xml?
- Fariska0
so.... you want to display a video in lightwindow, right?
Fact is that the link to that video (on the HTML) is caught dynamically by javascript, which creates the overlay and stuff. So, your navigateToURL call should call the javascript function that do all this stuff.
As i see from the lightwindow demo page it uses:
prototype.js, effects.js, lightwindow.js, and other javascript.I'd start checking out those pieces of code (starting from lightwindow.js) to see where is the function that fires all the process and which paramenters require. Once you spot that, just do a javascript:function (params) from the navigateToURL
- Fariska0
oh well, here we go:
myLightWindow.activateWindow({
href: 'http://stickmanlabs.com/images...
title: 'Waiting for the show to start in Las Vegas',
author: 'Jazzmatt',
caption: 'Mmmmmm Margaritas! And yes, this is me...',
left: 300
});"- from here: http://www.stickmanl… Scroll down to "Create and Launch a Window with a Javascript Call."Fariska
- wwfc0
...aaah wicked - cheers fariska - lets see
ou1
- wwfc0
...okay i'm getting this now - but how do i set the javascript call on that navigate to url? as3 is still new to me - so any help would be great ;-)
- wwfc0
...okay - that's a big help - thanks mate ;-)
- wwfc0
"var url = " javascript: mylightWindow.activateWindow ({ all, the, bunch, of, parameters, reuired, by, the, script}) "
var url is the url of .js? yes?
- wwfc0
is this how this last two lines should look?
don't know if i have just confused myself more here?function p_click(me:MouseEvent)
{
var sp:Sprite = me.target as Sprite;
var s_no:Number = parseInt(sp.name.slice(8,10));
var url = " javascript: mylightWindow.activateWindow ({ all, the, bunch, of, parameters, reuired, by, the, script}) "
var request:URLRequest = new URLRequest(url_list[s_no]), url_target_list[s_no]);
navigateToURL(new URLRequest(url_list[s_no]), url_target_list[s_no]);
}
- wwfc0
function p_click(me:MouseEvent)
{
var sp:Sprite = me.target as Sprite;
var s_no:Number = parseInt(sp.name.slice(8,10));
navigateToURL(new URLRequest("javascript: myLightWindow.activateWindow({hr... 'thumbnail_list_3.xml', class: 'lightwindow', title: 'TITLE', author: 'AUTHOR', caption: 'CAPTION'})"), "_self");
navigateToURL(new URLRequest(url_list[s_no]), url_target_list[s_no]);
}that is supposed to work - but doesn't?!
any idea? is it how the title author etc.. are added should they correspond to my xml settings?
- wwfc0
...i mean this...
function p_click(me:MouseEvent)
{
var sp:Sprite = me.target as Sprite;
var s_no:Number = parseInt(sp.name.slice(8,10));
navigateToURL(new URLRequest("javascript: myLightWindow.activateWindow({hr... 'index.html', class: 'lightwindow', title: 'TITLE', author: 'AUTHOR', caption: 'CAPTION'})"), "_self");
navigateToURL(new URLRequest(url_list[s_no]), url_target_list[s_no]);
}