Archive for July, 2005

Fit to Page Flash and the Evil DTD

Friday, July 22nd, 2005

Ok – I have used flash since Flash 4 so I feel dumb saying that I never do “Fit to Page” Flash pieces. SO now when I needed to do one (for the same Flash Paper piece on my last post) I run into problems with FireFox. Has anyone ever seen when you have the width and height set to 100% that FireFox only does the height? If you pull the DTD (bad, bad) it will work fine… Anyone seen this or have a “keep the DTD” fix?
-Sarge

Hacking Flash Paper to Make it Work for You

Friday, July 22nd, 2005

I haven’t worked with Flash Paper a lot but seems like we are starting to use it more at work. A client had this nice technical illustration that he wanted transformed into Flash Paper. The illustration was huge so when it was zoomed out it looked bad. I looked around and found that there is a Flash Paper API. This provided some nice features such as controlling the zoom, etc… That worked nicely but I need to find a way (once zoomed in) to reposition the “page”. I couldn’t find anything readily so I dug through the objects with loops and found a way. I thought I’d share this find.

While I’m on a Flash Paper kick I guess I’ll post this technote about getting a Landscape Flash Paper.

The code below uses code written by Damian Taggart to interface an swf wrapper which loads the Flash Paper swf file and then uses the API included within it to modify the document – from DevMX.
SHglobal { background-color: #FAFAFF; border: 1px dotted #CACAFA; padding: 5px } .ASHop { color:#0000FF } .ASHwrd { color:#000099 } .ASHnum { color:#990000 } .ASHqt { color:#666666 } .ASHcom { color:#CC00CC }

Stage.scaleMode = “noScale”;

Stage.align = “TL”;

stop();

/* loading a Flash Paper document by damian taggart
protoype loadFlashPaper:

([path to Flash paper .swf, destination mc,width, height, optional: obj to recieve notification when loading completes])

*/

var pathToSWF = “myFlashPaper.swf”;

var destMC = this.createEmptyMovieClip(“load_mc”,

this.getNextHighestDepth());

var wide = Stage.width;

var tall = Stage.height;

var notifyObj = destMC.getIFlashPaper();

function loadFlashPaper(pathToSWF, destMC, wide, tall, notifyObj) {

trace(pathToSWF);

var intval = 0;

var loadFP = function () {

destMC._visible = false;

var fp = destMC.getIFlashPaper();

if (!fp) {

trace(“not loaded”);

return;

}else if (fp.setSize(wide, tall) == false) {

trace(“not yet loaded”);

return;

}else {

destMC._visible = true;

clearInterval(intval);

onLoaded(fp);

}

}

intval = setInterval(loadFP, 100);

destMC.loadMovie(pathToSWF);

}

// change the FP control bar

function onLoaded(fp) {

trace(“UI changes called”);

fp.enableScrolling(true)

fp.setSize(Stage.width,Stage.height);

fp.setCurrentZoom(186);

for(c in fp.m_mainMC.document_mc){

trace(“c” + c);

}

fp.m_mainMC.document_mc.y_sb.m_scrollPosition = 180;

fp.m_mainMC.document_mc.x_sb.m_scrollPosition = 20;

}

loadFlashPaper(pathToSWF, destMC, wide, tall, notifyObj);

As you can see it was two measly lines that go and reference the scrollbars and set the positions.

fp.m_mainMC.document_mc.y_sb.m_scrollPosition = 180;
fp.m_mainMC.document_mc.x_sb.m_scrollPosition = 20;

You can do the same by hitting the mc that is scrolled (just do some for in loops – you’ll find it) and repositioning it – just keep in mind this screws scrollbars up so I don’t advise this unless you have the scrollbars shut off.

Hope this helps.
-Sarge

iTunes Album Art V1.3 Released

Tuesday, July 19th, 2005


1.3 UPDATE

I updated iTunes Album Art to version 1.3 and added a few new features. You can download the new build here.

New Features Include:

  • Delete the album art from the current song.
  • Update all the songs on the album of the current track.
  • Update your entire library.

These features were all requested by users of iTunes Album Art. I avoided the “shotgun” approach to updating your entire library as it can take some time depending on the size of your library. I added a progress bar to let you know how long things were going to take. I also updated some code so non-MSN messenger users should have less problems. Also, the initial preference should be to NOT update your MSN Messenger picture.

Some side notes. If anyone has excellent icon creation skills and wants to donate a custom icon for the app I will add your name to the “about” section and give you mad props. Any other developers out there that want to shed light on handling events from WinAmp (because it is C++ based and not C# based) in C# I’d love to listen.

Again – please let me know what you think – especially if you use it and like it. I will try to add any features I can that don’t kill me in the process. Thanks!
-Sarge

–Version 1 Release Follows–

Awhile back I started work on an application that would run while you had iTunes open and look at the song currently playing. If your song did not have album art associated with it the app would access the web, download the art and inject it into the file all without user intervention. I finally have a somewhat stable build and I thought I’d release it. I mean C# is close enough to ActionScript right? Let me know what you think. I hope this is useful to you all. If I get enough good feedback I’ll keep adding features. Below is a list of features, requirements and instructions.

Features:

  • Update your MSN Messenger IM Picture with the current song’s album art!
  • Runs quietly in the system tray.
  • Injects songs with album art if none is present, leaves songs with album art alone.
  • Allows you to extract art as a JPG from your songs and from the songs being shared over the network!
  • Allows you to control Next and Previous track.

Requirements:

  • Windows Machine
  • The .NET Framework

Instructions:

DOWNLOAD the app and extract all of the contents of the zip to a directory. I didn’t write an installer for this. You can drag a shortcut to your Start Up items to have the app start every time you boot. Make sure iTunes is closed – the app won’t be able to detect song changes if you do not. Run the app. You should see the icon in your system tray. You can double click the icon or right click on it and select Show Song Info. The window seen above should show. You can manually control the app from here (remember it will take care of updating the song art as you listen to iTunes without you doing anything!). When you minimize or close the window it will return to the system tray. To exit – choose exit from the main menu or on the right-click menu on the icon in the system tray. If you have any start-up issues it may be because of an MSN Messenger conflict. You can edit the preferences XML file and change True to False to solve the problem.

Jumping the Great Wall of China and Some Nice Flash Video Usage

Friday, July 8th, 2005

This guy is amazing and is planning on jumping the Great Wall of China on a skateboard tomorrow. Thought I’d blog it because I really like the use of Flash video on this site – good picture and audio… Nicely integrated. Enjoy.
http://www.dannydoeschina.com/