jlach01
01-26-2005, 02:29 PM
Hey yall... I have searched for help on this, but I haven't been able to locate anything that might help me with the problems I'm having. Heres whats going on.. I have my main .swf file, wich has the links and all.. when you click a link, it shows a movie clip on part of the main .swf file. I want this MovieClip to be scrollable, so I need to be able to set the size of the MovieClip, wich might be smaller then the actual size of the movie i'm loading.. The problem I'm having is the minute i try to set _width and _height is my movieclip dosen't show. I'm using a MovieClipLoader... heres the code, Thanks in advance! :)
var contentMCL:MovieClipLoader = new MovieClipLoader();
var contentMCListener = new Object();
// -- Object Listeners --
contentMCListener.onLoadStart = function(targetMC) {
contentMC._visible = 0;
txtLoad._visible = 1;
txtLoadProgress._visible = 1;
progressText = "<p align=\"center\">Getting Total Bytes...</p>";
};
contentMCListener.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
loadProgress = Math.ceil((loadedBytes / totalBytes) * 100);
if (!loadProgress) {
loadProgress = 0;
}
progressText = "<p align=\"center\">Completed: " + loadProgress + "%</p>";
};
contentMCListener.onLoadComplete = function(targetMC) {
progressText = "<p align=\"center\">All Bytes Recieved</p>";
};
contentMCListener.onLoadInit = function(targetMC) {
txtLoad._visible = 0;
txtLoadProgress._visible = 0;
contentMC._visible = 1;
};
contentMCL.addListener(contentMCListener);
// -- Functions --
function loadContent(path:String):Void {
contentMCL.unloadClip(contentMC);
contentMC._width = 440;
contentMC._height = 430;
contentMCL.loadClip(path, contentMC);
}
// -- On 'Home' Button --
on (release) {
loadContent("home.swf");
}
var contentMCL:MovieClipLoader = new MovieClipLoader();
var contentMCListener = new Object();
// -- Object Listeners --
contentMCListener.onLoadStart = function(targetMC) {
contentMC._visible = 0;
txtLoad._visible = 1;
txtLoadProgress._visible = 1;
progressText = "<p align=\"center\">Getting Total Bytes...</p>";
};
contentMCListener.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
loadProgress = Math.ceil((loadedBytes / totalBytes) * 100);
if (!loadProgress) {
loadProgress = 0;
}
progressText = "<p align=\"center\">Completed: " + loadProgress + "%</p>";
};
contentMCListener.onLoadComplete = function(targetMC) {
progressText = "<p align=\"center\">All Bytes Recieved</p>";
};
contentMCListener.onLoadInit = function(targetMC) {
txtLoad._visible = 0;
txtLoadProgress._visible = 0;
contentMC._visible = 1;
};
contentMCL.addListener(contentMCListener);
// -- Functions --
function loadContent(path:String):Void {
contentMCL.unloadClip(contentMC);
contentMC._width = 440;
contentMC._height = 430;
contentMCL.loadClip(path, contentMC);
}
// -- On 'Home' Button --
on (release) {
loadContent("home.swf");
}