Advertisement
Advertisement
| 06.24.2008 at 02:43AM PDT, ID: 23510356 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: |
function createMovieClipLoaderObject($newObjectName){
//Just store a copy of the name of the object into a new variable:
var $newObject = $newObjectName;
//Convert it to an object:
var $newObject:MovieClipLoader = new MovieClipLoader();
//create a unique name for this listener:
var $listener_name = $newObjectName+"_listener";
//save the new name:
var $listener = $listener_name;
//keep the name, but convert it to an object:
var $listener:Object = new Object();
$listener.onLoadStart = function(target_mc:MovieClip) {
trace("*********"+$newObjectName+" instance*********");
trace("onLoadStart event triggered:");
trace("Your load has begun on movie clip = "+target_mc);
var loadProgress:Object = $newObject.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at start");
trace(loadProgress.bytesTotal+" = bytes total at start");
};
$listener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
trace("*********"+$newObjectName+" instance Progress*********");
trace("onLoadProgress event triggered:");
trace("onLoadProgress() called back on movie clip "+target_mc);
trace(loadedBytes+" = bytes loaded at progress callback");
trace(totalBytes+" = bytes total at progress callback");
};
$listener.onLoadComplete = function(target_mc:MovieClip) {
trace("*********"+$newObjectName+" instance*********");
trace("onLoadComplete event triggered:");
trace("Your load is done on movie clip = "+target_mc);
var loadProgress:Object = $newObject.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at end");
trace(loadProgress.bytesTotal+" = bytes total at end");
};
$listener.onLoadInit = function(target_mc:MovieClip) {
trace("*********"+$newObjectName+" instance*********");
trace("onLoadInit event triggered:");
trace("Movie clip = "+target_mc+" is now initialized");
// you can now do any setup required, for example:
//trace("width of image is: "+target_mc._width);
//trace("height of image is: "+target_mc._height);
};
$listener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
trace("*********"+$newObjectName+" instance*********");
trace("onLoadError event triggered:");
trace("ERROR CODE = "+errorCode);
trace("Your load failed on movie clip = "+target_mc+"\n");
};
$newObject.addListener($listener);
return $newObject;
};// end function create object
//====================================================================
//create new object to handle the loading:
var $my_test = createMovieClipLoaderObject("my_test");
//create empty movie clip to use as container for jpg:
_root.createEmptyMovieClip("bg_mc", _root.getNextHighestDepth());
// Now load the file into target mc
$my_test.loadClip("tile1.jpg", _root.bg_mc);
//when the file is completely loaded, duplicate the mc:
$my_test.onLoadInit = function(target_mc:MovieClip){
duplicateMovieClip(target_mc, "bg", _root.getNextHighestDepth());
};//end onLoad init
==========================
Actionscript for testing button:
testbutton.onRelease = function(){
trace("duplicate x is: " + _level1.bg._x);
};
|