7 3 29th 2009
§
§ permalink
I didn’t like what I saw, when I went looking… so I kinda made my own.
$(document).ready(function()
{
// activete the first item
$(".accordion .query:#news").animate({height: 470}, 750);
// drop the active text
$(".accordion .query:#news").find(".activate").animate({opacity: "0", top: 450},760);
$(".accordion .query").click( function()
{
// grow!
$(this).animate({height: 470}, 750);
//
$(this).find(".activate").animate({opacity: "0", top: 450},760);
// this is how I will set the id of the expanded swf
var a = $(this).attr('id');
//alert( a ) ;
// truncate the non active bastards
$(this).siblings(".query").animate({height: 150}, 750);
//
$(this).siblings(".query").find(".activate").animate({opacity: "1",top: 130},760);
});
});
→ Surrender.
7 3 29th 2009
§
§ permalink
Keypress in AS3:
// alert back keys that are pressed
addEventListener( KeyboardEvent.KEY_DOWN, keyHandler );
// key press alert
function keyHandler( e:KeyboardEvent ):void
{
trace("[ " + e.keyCode + " ]");
}
For the same thing in AS2:
var keyListener:Object = new Object ();
keyListener.onKeyUp = function()
{
trace ( "Key: " + Key.getCode() );
};
Key.addListener (keyListener);
This looked a lot cooler before I trimmed it down for the post.
7 3 29th 2009
§
§ permalink
I’m not a fan of ExternalInterface, but it is good to have in your pocket.
I have another post for AS2 External Interface [ here ]…
<script language="JavaScript">
var jsReady = true;
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
//-- is EXT INT ready?
function EXactive()
{
return jsReady;
}
//-- fetch id
function GetID()
{
return thisMovie("ExternalInterfaceExample");
}
</script>
→ Click this.