473,774 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MovieClipLoader

11 New Member
Hi, ive managed to import files into a main fla document using a moviecliploader command. The code tracks the percentage of the file downloaded so far and shows this information in a preloader bar. The problem is whenever I import a swf file it tries to play before it is 100% loaded. To counter this I added some more code to solve this (see bold text). The code is supposed to hide the swf file until it is 100% loaded then show and play it. The code hides and shows the swf fine, but still seems to play the file in the background. Would really appreciate some help with this one, hear is the code:

loadbar._visibl e = false;

//set up a MovieClipLoader and a Listener for "listening" to the callback events of the MovieClipLoader
var myLoader:MovieC lipLoader = new MovieClipLoader ();
var myListener:Obje ct = new Object();

myListener.onLo adStart = function(){
trace ("started loading" );
}
myListener.onLo adProgress = function(){
percent = Math.floor(box5 .getBytesLoaded ()/box5.getBytesTo tal() * 100);
loadbar._visibl e = true;
loadbar.gotoAnd Stop( percent );
trace ( percent );

//script to ensure that the movieclip is only displayed and played when it is 100% loaded
if (percent < 100){
gotoAndStop(box 5);
box5._visible = false;
} else {
box5._visible = true;
gotoAndPlay(box 5);
}
}


myListener.onLo adComplete = function(){
trace ("loaded");
loadbar._visibl e = false;
}

// add the listener object to the movieCLipLoader
myLoader.addLis tener(myListene r);
myLoader.loadCl ip ("materials/rotoscope.swf" , box5);

stop();

Thanks in advance,

Martin
Jun 28 '07 #1
2 2272
Martin84
11 New Member
Doesn't matter, problem solved now
Jun 29 '07 #2
Motoma
3,237 Recognized Expert Specialist
Care to post your solution so others may learn from it as well?
Jun 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2217
by: Colazz | last post by:
var myMCL:MovieClipLoader = new MovieClipLoader(); myMCL.loadClip("apin.jpg", "container"); //container is an instance of a movie clip. Now, the size of "apin.jpg" is too large.. is there any code that i can use to make the pics displayed in certain fixed size ? thx before
5
7164
by: Colazz | last post by:
Suppose that i load a picture inside my movie clip mc.loadMovie("pic.jpg"); How can i know the dimension of the "pic.jpg" ? I need the info such as the width and height of the pic to continue with my scripting. (such 1024 x 768 or 680 x 480). Well, the reason i want to do this is to make a photo gallery and i want to put all pics with different dimensions into the frame that i've created. Thx for advance
4
8066
by: Martin84 | last post by:
Hi, im attempting to build a portfolio website in flash professional 8 and want to import an .swf file into the .fla document but I cant get it to work. I created white square then converted it into a movie clip (realisticface_mc) and attached the following code (found in the flash help section): onClipEvent (enterFrame){ loadMovie("C:\wamp\www\portfolio\materials\realisticface.swf", realisticface_mc); } I dont get any error...
1
5655
by: Tarik Monem | last post by:
Hi Everyone, As usual, after trying what I can, I come here to ask for your help. Once I found out that scrollToIndex was not working in Flash, but it was working within Flex, then I started to learn Flex, so I'm a newbie. I am trying to load an xml file into flex to populate a HorizontalList of images. I am able to populate a datagrid using the same logic with no problem, but I have yet to be able to populate the HorizontalList, and...
2
4566
by: Max58kl | last post by:
Hi I am trying to load a swf file using the MovieClip loader object. var myMCL:MovieClipLoader = new MovieClipLoader(); var myListener:Object = new Object(); myMCL.addListener(myListener); At the moment I have the swf loading as soon as a frame is entered on the timeline.
8
2838
by: chromis | last post by:
Hi, I've been struggling to get sounds to work with attachSound when the sounds are stored in a swf loaded into another swf. I came across a post on a forum which supposedly explains how to to do it, however i tryed what it suggested and it doesn't work. (link) I then tryed to use the MovieClipLoader class so that once the swf was loaded the sound would be played. What is strange though is that when the swf has loaded i can return a valid...
0
2309
nomad
by: nomad | last post by:
Hello Everyone. I founded an Flash and xml photo gallery. It works but I took it to another step What I want is to have six different galleries in one Flash file. I figure out how to do that but when I click on the the galleries I can see the pervious gallery files. The gallery works like this: When you open the gallery there are links on top of the page where you can go to other gallery; with gallery one which has small thumbnails on...
49
5975
anfetienne
by: anfetienne | last post by:
is it possible to add php array to vars in the swfobject code?
1
3653
anfetienne
by: anfetienne | last post by:
i have this code below that i made....it loads vars from txt file splits it then puts it into an array....once in an array it the brings the pics in from the array to create thumbnails and a larger image. my problem is i have captions to go with it and when i try to load the captions nothing happens or can be seen to be happening. i dont know where i am going wrong as i have no output or compiled errors var locVar = new Array();...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9915
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4014
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.