2 Attachment(s)
Shadowbox/Thickbox in flash! (working!)
If you ever wondered how to implement a shadowbox or thickbox in flash then look no further!
Here are two examples
I did the shadowbox and someone else did the thickbox :( sorry i forgot source - if it is yours please let me know and I will acknowledge
From my experience on using both of them, i found that a shadowbox is a much better option.
Shadowbox uses javascript to hide the swf object when shadowbox is open - can display flash movies in shadowbox itself.
Thickbox relies on wmode = 'transparent' to show the thickbox on top of the flash - very crude solution which slows down you flash heavily and doesnt work in all browsers.
Datagrid + ExternalInterface.call not working...
So here's a good one. If I have a very simple datagrid with a CHANGE event handler, the ExternalInterface.call() does not work. If I trace(ExternalInterface.call) I receive a value of NULL. Can anyone give me a reason? Thanks!
AS3 Datagrid:
Code:
import fl.data.DataProvider;
import fl.controls.DataGrid;
import fl.controls.dataGridClasses;
import flash.external.ExternalInterface;
bldRosterGrid(aDg);
var aRoster:Array = new Array();
aRoster = [
{Name:"http://localhost:8888/user_auth/1.gif", Bats:"R", Throws:"R", Year:"So", Home: "Redlands, CA"},
{Name:"Sue Pennypacker", Bats:"L", Throws:"R", Year:"Fr", Home: "Athens, GA"},
];
aDg.dataProvider = new DataProvider(aRoster);
aDg.rowCount = aDg.length;
function bldRosterGrid(dg:DataGrid){
dg.setSize(400, 300);
dg.columns = ["Name", "Bats", "Throws", "Year", "Home"];
dg.columns[0].width = 250;
dg.columns[1].width = 250;
dg.addEventListener(Event.CHANGE, changeHandler);
};
function changeHandler(event:Event):void{
ExternalInterface.call("abrirSB",'img', 'Title', 'images/test_image.jpg');
}
HTML:
Code:
same as above posts html code
Having two problems with this code
Hello,
I downloaded the shadowbox code and tried it out. It's mostly working but I'm stuck in two places.
1. The third blue box to the right should be calling a swf and that fails. I know it's named properly.
2. My images don't know that they are in a series (1st two are JPGs and the third is a .swf) and my shadowbox is missing the pagination at bottom.
Here's a link:
http://jimmygnass.com/shadowbox2/Fla...Shadowbox.html
Here's my code in flash. BTW, I'm writing in AS3.
stop();
import flash.external.ExternalInterface;
// - - - - - - - This is an event handler - - - - - - - //
function handleCLICK(event:MouseEvent):void {
if (event.target == myButton1)
{
// handle this event
ExternalInterface.call("abrirSB",'img', 'My Image 1', 'myimage1.jpg');
}
if (event.target == myButton2)
{
// handle this event
ExternalInterface.call("abrirSB",'img', 'My Image 2', 'myimage2.jpg');
}
if (event.target == myButton3)
{
// handle this event
ExternalInterface.call("abrirSB",'img', 'My Image 3', 'myimage3.swf');
}
}
// Now we register the event
myButton1.addEventListener(MouseEvent.CLICK, handleCLICK);
myButton2.addEventListener(MouseEvent.CLICK, handleCLICK);
myButton3.addEventListener(MouseEvent.CLICK, handleCLICK);
// - - - - - - - This is the end of the event handler - - - - - - - //
One more thing, I've tried putting these links in the body of my HTML page using this code:
<a href="myimage1.jpg" rel="shadowbox[Gallery Name]" title="My Image 1">My Image</a><br/>
<a href="myimage2.jpg" rel="shadowbox[Gallery Name]" title="My Image 2">My Image 2</a><br/>
<a href="myimage3.swf" rel="shadowbox[Gallery Name]" title="My Image 3 - Flash">My Image 3</a>
And that works perfectly. I don't have either of the two problems that I've described above, so I'm pretty sure it's in my "ExternalInterface.call".
If anyone knows how I can resolve this, I would greatly appreciate it.
Jimmy