// see the source files found in the zip in the URL above.
// Thanks to Nate63179 for the idea of ClickTag URL rollover
// http://snipplr.com/view/14239/actionscript-20-click-tag-handler/
debugg("testing");
//**************************** BEGIN DEBUG FUNCTION
function debugg(whichText:String)
{
debug_txt.text += "\n\n" + whichText;
trace("\n\n" + whichText + "\n\n");
}
onEnterFrame = function() {
if ((Key.isDown(Key.BACKSPACE))) {
if ((Key.isDown(Key.LEFT))) {
if (Key.getCode() == 17) { // so, press BACKSPACE+LEFT, and CONTROL (in that order, together) to reveal the debug
debug_txt._y = Stage.height / 2;
}
}
}
};
//**************************** END DEBUG FUNCTION
var imageListener:Object = new Object();
imageListener.onLoadInit = function() {
var aimageTween:Tween = new Tween(holder_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
}
var imageLoader:MovieClipLoader = new MovieClipLoader();
imageLoader.addListener(imageListener);
imageLoader.loadClip("/photos/filename.png", holder_mc);
///////put this somewhere with your other functions//////
TextField.prototype.applyStyles=function(styles){
fmt = new TextFormat();
for (var key:String in styles){
fmt[key]=styles[key];
}
this.setTextFormat(fmt);
}
////////pass in an object with all the styles you want
myTextField.applyStyles({color:"0xFFFFFF",letterSpacing:-2,bold:true,size:18});
/* here's some other styles (flash8)
myTextField2.applyStyles({
align:"center",
blockIndent:10, //indents the text block 10pt
bullet:true;
font:"Gill Sans",
indent:"3", //indents first character 3pt
italic:true,
kerning:true, //kerning enabled
leading:15, //15 pixels (line spacing)
leftMargin: 10, //10 point left margin
leftMargin: 10, //10 point right margin
underline:true,
color:"0xFFFFFF",
letterSpacing:-2,
bold:true,
size:18
});
*/
import flash.display.*;
function loadBitmapSmoothed(url:String, target:MovieClip) {
// Create a movie clip which will contain our unsmoothed bitmap
var bmc:MovieClip = target.createEmptyMovieClip("bmc",target.getNextHighestDepth());
// Create a listener which will notify us when the bitmap loaded successfully
var listener:Object = new Object();
// Track the target
listener.tmc = target;
// If the bitmap loaded successfully we redraw the movie into
// a BitmapData object and then attach that BitmapData to the target
// movie clip with the smoothing flag turned on.
listener.onLoadInit = function(mc:MovieClip) {
var mc:MovieClip = mc;
mc._visible = false;
// mc.forceSmoothing
var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true);
this.tmc.attachBitmap(bitmap, this.tmc.getNextHighestDepth(),"auto", true);
bitmap.draw(mc);
};
// Do it, load the bitmap now
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
loader.loadClip(url, bmc);
}
// Sample code
createEmptyMovieClip("mc1", getNextHighestDepth());
mc1.createEmptyMovieClip("mc", mc1.getNextHighestDepth());
//mc1.mc.loadMovie("flash.png");
loadBitmapSmoothed("http://digitallibrary.usc.edu/assetserver/controller/rendition/VIT-001470/page-1", mc1.mc);
mc1.onEnterFrame = function() {
// Ugly, but we are not using a MovieClipLoader for the unsmoothed case
mc1.mc._x = -150;
mc1.mc._y = -230;
mc1._x = Stage.width / 2;
mc1._y = Stage.height / 2;
mc1._rotation += 0.5;
}