| Ultrashock Forums
• AS2 - loadMovie question |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
2008-06-19
#2 |
||
|
|
|
2008-06-19
#3 |
||
|
Last edited by gabrielsj : 2008-06-19 at 12:17.
that's strange! if you type inside the actions box "loadmovie" it will open: Code:
loadMovie(url, target, method); I am having some issues with my buttons. They all stand inside an external swf (interface.swf) that has been loaded into my project = "main.swf". Now on root, I've set on last frame that "news" will be my first movie to be loaded in: Code:
_root.currMovie = "news"; _root.newsContainer.loadMovie(_root.currMovie+".swf"); Code:
this.onPress = function() {
//unload other movies
_root.contactContainer.unloadMovie("contact.swf");
_root.aboutContainer.unloadMovie("about.swf");
_root.newsContainer.unloadMovie("news.swf");
if (_root.currMovie == undefined || _root.currMovie != "portfolio") {
_root.currMovie = "portfolio";
_root.portfolioContainer.loadMovie("portfolio.swf");
}
}
So there is some issue blocking on first click. |
|
|
2008-06-19
#4 |
||
|
ActionScript Code:
not sure if you missed that "
|
|
|
|
2008-06-19
#5 |
||
|
Last edited by gabrielsj : 2008-06-23 at 09:57.
sorry, fixed that, i wrote it badly up there. ...just solved my problem on that part, but... I'm noticing that when I load in a external swf, it's preloader never works, always gets all bytes before even showing the preloader, small or big files, it doesnt really matter the size. I'm woundering if this approach isn't wrong. On my main fla I have that button: Code:
this.onPress = function() {
if (_root.currMovie == undefined || _root.currMovie != "portfolio"){
_root.currMovie = "portfolio";
_root.portfolioContainer.loadMovie("portfolio.swf");
}
}
Code:
stop();
var loadingCall:Number = setInterval(preloadSite, 50);
function preloadSite():Void {
var siteLoaded:Number = getBytesLoaded();
var siteTotal:Number = getBytesTotal();
var percentage:Number = Math.round((siteLoaded/siteTotal) * 100);
//my loader movieclip
centerLoader.percent.text = percentage + "%";
if (siteLoaded>=siteTotal) {
clearInterval(loadingCall);
gotoAndStop(2);
}
}
|
|
|
|
2008-06-23
#6 |
||
|
I updated my issue on post above. thanks
|
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


5 comments
| 8057 views


Linear Mode
public loadMovie(url:String, [method:String]) : Void
Parameters
url:String - The absolute or relative URL of a single SWF, JPEG, GIF, and PNG file to be loaded. A relative path must be relative to the SWF file at level 0. Absolute URLs must include the protocol reference, such as http:// or file:///. For more than one SWF, JPEG, GIF, or PNG, use subsequent calls to loadMovie().
method:String [optional] - Specifies an HTTP method for sending or loading variables. The parameter must be the string GET or POST. If no variables are to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.