Archive for the ‘Flash’ Category

Snippets: HTML object swf embed within a WordPress post snag it n’ publish it code excerpt

Wednesday, December 29th, 2010

<object height=”24″ width=”500″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0″ classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″><param value=”file=http://www.site.net/track.mp3&amp;image=http://www.site.net/trackImage.jpg” name=”flashvars”><param value=”http://www.site.com/swf/player.swf” name=”movie”><embed height=”24″ width=”500″ flashvars=”file=http://www.site.net/track.mp3″ pluginspage=”http://www.macromedia.com/go/getflashplayer” type=”application/x-shockwave-flash” src=”http://www.site.com/swf/player.swf”></object>

output XML with PHP (here loaded by Flash)

Tuesday, December 28th, 2010

using something like this in Flash AS perhaps?

playlist.load(“http://www.site.com/playlist.xml”);

wish it were this instead?

playlist.load(“http://www.site.com/playlist.php”);

instead of something like this in xml thus that must be updated…:

<songs><song file=’http://www.site.com/songs/1.mp3′  />
<song file=’http://www.site.com/songs/2.mp3′ /></songs>

you could have something like this, that updates the output xml file each time a new file is added to the songs directory:

< ? p h p

header(‘Content-type:text/xml; charset=utf-8’);
echo “<songs>”;

if ($handle = opendir(‘../songs’)) {
while (false !== ($file = readdir($handle))) {
if ($file != “.” && $file != “..”) {
//echo “$file\n”;
$file_no_extension = implode(‘.’, explode(‘.’, $file, -1));
echo “<song name=’ ” . $file_no_extension . ” ‘ file=’http://www.site.com/songs/” . $file . “‘ />”;
}
}
closedir($handle);
}

echo “</songs>”;
? >

Flash Session Cookie SharedObject

Wednesday, July 7th, 2010

http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/net/SharedObject.html

http://en.wikipedia.org/wiki/Local_Shared_Object

http://www.adobe.com/support/flash/action_scripts/actionscript_tutorial/actionscript_tutorial05.html

to change settings:

right click on any flash swf

or

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html

stored here:

  • Windows XP:
    • For Web sites: %APPDATA%\Macromedia\Flash Player\#SharedObjects\<random code>\<domain>\<path – maybe°>\<object name>.sol
    • And Also: %APPDATA%\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys
  • Windows Vista and later:
    • For Web sites: %APPDATA%\Macromedia\Flash Player\#SharedObjects\<random code>\<domain>\<path – maybe°>\<object name>.sol
    • And also: %APPDATA%\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys
    • For AIR Applications: unknown, likely similar to the above

Actionscript 3 Make Cursor a Hand

Tuesday, March 2nd, 2010

The goal:

SIMPLY turn the cursor into a hand
(over something that really isn’t a button, in this case it’s just a dynamic URLREQUEST function/link).

Nice and simple solution:

top of your AS3 package:
import flash.ui.Mouse;

in function reacting to mouse movement or loader success:
this.buttonMode = true;

Actionscript 3 Link

Tuesday, March 2nd, 2010

import flash.net.navigateToURL;
this.addEventListener(MouseEvent.CLICK, fOnClick);

private function fOnClick( e : MouseEvent ):void {
var request:URLRequest = new URLRequest(“http://www.google.com”);
navigateToURL(request);
}