Load all movie clips
Hi,
I have a "map_mc" movie clip that has over 500 movie clips(counties). I also have the countynames in xml format. I want to be able to
1. in a loop get a list of all movie clips
2. and in a dynamic text box assign the county name to the movie clip (from xml).
Is it possible to get the names of all movie clips and then assign the countynames?
I have the xml part semi working and on mouseover can display the name but is stuck on the movie clip part.
I am trying to avoid typing all the county names and in the future will be adding census and other data to the xml.
can someone help?
if you had an xmlList of 500 countynames, and if the 500 movieclips inside maps_mc each had names such as mc0, mc1, mc2, etc, you could loop thru them like this:
for(var i = 0; i < xmlList.length(); i++){
//get reference to county movieclip
var mc = maps_mc.getChildByName("mc" + i);
//then add listeners
mc.addEventListener(MouseEvent.ROLL_OVER, overMe);
mc.addEventListener(MouseEvent.ROLL_OUT, outMe);
function overMe(e:MouseEvent){
//the county you rolled over
var mc = e.target;
//extract the number from the name
var n = Number(mc.name.substr(2));
//use n to get countyname from xmlList
var countyname = xmlList[n];
trace(countyname);
//now add countyname to a textField
textField.text = countryname;
function outMe(e:MouseEvent){
//clear textField
textField.text = "";
Similar Messages
-
Hi,
Is there a code to remove all movie clip when a button is
press? Sorry. Im new to AShey Scruffy - as I mentioned in your other post it will
depend on how these clips were brought to the Stage to a certain
degree. to be safe one should go ahead and use swapDepths first and
then iterate through all MCs within the swf, as in the following: -
Loading a movie clip loses my script function
I have an art gallery that is in three parts. The Flash movie
used to load everything before opening, but the gallery has grown
too large. So now I've divided it up into three sections. The first
section loads the first set of pics with the movie. The second and
third sections load when you click on the relevant buttons. The
interface (root movie) has 2 movie clips per section - the
thumbnails (all three of which load with the movie) and the large
pics of the thumbnails. So when you click on a thumbnail the proper
large work shows in the other movie clip. This all worked fine
using this code in my thumbnails for the largeWorks sections:
stop();
large1_btn.onPress = function (){
_root.largeWorks_mc.gotoAndStop(1);
large2_btn.onPress = function (){
_root.largeWorks_mc.gotoAndStop(2);
etc...
This code is in the thumbnail movie script. Notice it calls
_root.largeWorks_mc
Now when you click on See Large Works button a place holder
movie clip (target) called largeWorksE_mc is replaced with
largeWorks_mc.
The button uses the code:
loadMovie("largeWorks_mc.swf",_root.largeWorksE_mc);
But now when I click on the thumbnails nothing happens. My
thumbnail movie clip is no longer communicating with the loaded
movie clip. What have I done wrong?I had trouble following your explanation.
If code is disappearing, it is probably code in a MovieClip
that a loadMovie replaces with another external movie. When using
loadMovie, the MovieClip in it is destroyed and the timing is not
something you can predict. -
Is there a way to clear ALL event listeners, stop all movie clips, etc?
Is there a syntax for this?
I have a movie that has 15 frames. Each frame has embedded movie clips within movie clips, tons of animations and event listeners. None is needed except when they are on the stage, on the frame. However, the animations continue even when the frame is left.
For instance, I have a frame that has a dynamically rendered animation of leaves falling from a tree. When the frame is left, the leaves continue to fall.
There are many instances of this type of thing happening.
Ideally, I would love to just be able to clear everything when a new frame is loaded, since none of the animations or event listeners need to carry over from one frame to another.
Is there a way to do this without the thousands of lines of code it would take to manually remove every single animation and event listener and sound, etc, from the stage?
Thanks so much!!
Amberyou have to manually do that.
or, you could convert each frame to a swf. load each swf when needed and, if you're publishing for fp 10+, you can apply unloadAndStop() to kill all streams in the loaded swf and ready those assets for gc. -
'Load external movie clip' behavior
I am currently working on a flash movie that loads with an
animation and stops to show four buttons that are then supposed to
load external .swf files when clicked (released). While the
behaviors and actions I have set all work fine when I test the
movie in Flash, when all the files are uploaded to my server, the
external movie clip does not load, and the message in the bottom
left corner of the browser hangs at waiting for
www.panoramalotforsale.com...
Anybody any idea what I'm doing wrong?When everything works fine locally, but fails to load live on
your webserver, there is of course a pathing problem.
So, in your flash, when you call loadMovie, try using a full
path to the external file your trying to load.
So for example, instead of "/movies'/myexample.swf", do "
http://www.yoursite.com/movies/myexample.swf".
Make sure you keep the
http:// though. -
IE tries to load all movies if set to 'autoplay'
I have created modules with many video clips included. These are all set to autoplay when the user gets to the slide. This works fine in Safari, Chrome and FF. However in IE 7 and 8 the browser tries to load ALL the movies when the swf first loads leading to crash/hang.
If I turn off autoplay it behaves - but I would rather the videos autoplay when the user gets to a page.
Any ideas!Hi Vish
I have tested on IE7 under XP and IE8 under Vista
In both cases it seems that IE (only) tries to load the movies in the module
multiple times. I have used an Http analyser to log calls to the server and
with IE see multiple loads of the same movie before the module has started
like below:
18 False + 5.344 True 145.610 s GET 200
22.37 M (None)
http://learning.pukkafilms.com/file.php/2/moddata/scorm/13/mod1.flv
19 False + 11.578 True 139.345 s GET
200 22.52 M video/x-flv
http://learning.pukkafilms.com/file.php/2/moddata/scorm/13/mod1.flv
I have tried turning off autoplay on the movies, and tried turning off the
'prloader' option when publishing and tried turning off the autoplay when
publishing but IE seems to still try and download any movies linked in the
module.
If you want to try on windows 7 you can access the course at
learning.pukkafilms.com and use the enrolement key 'trial'
Of course it may be a moodle thing!
Nick
I have now run quite a few tests... each module I have contains around 5 movies. If I split the module into 5 sub modules and link from module to module, only the first movie loads in IE and they all play OK. But this is a bore as new SWFs have to load every 3 or 4 pages. However it is a workaround!
I am still interested in why IE tries to preload all the movies linked to from a single Captivate SWF. I have updated to latest players and am using the 'patched' captivate 5 to recover from last flash player update.
The problem is not evident when playing locally - but I suspect the overhead on IE is smaller.
N
Message was edited by: crispin62 -
I have a huge movie clip to be imported, its pretty huge so I
divided them to smaller pieces and tried to import, everything my
PC gets hung and does not respond after import. What is the best
method to import a single huge movie clip? Your help is
appreciated.Problem Solved.
To everyone that has experienced some version of this issue,
whether it be in previewing a load progress bar, or having
animation freeze on you while loading external movie files...
In test mode in flash, whether you are doing a simple test
movie or debugging, loading progress appears to not be threaded and
will freeze you movie until the load is complete. if you preview
this movie clip in a browser after publishing it, everything should
look ok.
I've read a lot of posts about this same topic. Macromedia
(or shall i say Adobe), fix this issue in your next release. what a
pain...seriously. debugging is useless if the movie doesn't even
run the same.
very much relieved,
Al. -
Closing swf loaded into movie clip
I have built a movie clip on my main flash file that I am loading separate swfs into. On the separate swfs I have a close button, but do not know what action script to attach to it to make the movie clip go away? I want these to go away every time you hit the close button on the separate Flash swfs loading into the main movie clip.
if the target movieclip has a non-negative depth and the close button is encoded on the loaded swf's main timeline, you can use:
var tl:MovieClip=this;
path.closeBtn.onRelease=function(){
tl.removeMovieClip(); -
Preload ALL movie clips?
I am experiencing a delay or pause in the site when my first
movie of content is played ... A frew frames before the initial
animation is finished I add in :
_root.conten.gotoAndPlay("start1");
to start the home page (or the first page of my content
movie, whatever you want to call it)....
Is this a preloader problem? I just can't seem to iron it
out.
To See It:
http://www.itamidesign.com/new.html
The Code is also here:
http://www.itamidesign.com/new.fla
THANKSno no there's always a way, i was just pointing you in the
direction of the easiest way.
the first thing you need to do is check getBytesLoaded at
regular intervals rather than in a loop on a frame. this can be
achieved several ways - i've used setInterval in the example i
prepared for you.
the second thing you need to do is check that getBytesTotal
has been received from the jpg okay - this can be checked by
ensuring that getBytesTotal>4, which is the size of an empty
movie clip.
the code i have attached is independent of your xml code,
which was really confusing things, as it is unrelated to your
loader code (one problem at a time!). once you're happy with your
loader code, then you can integrate it with your working xml code.
good luck
craig -
Disabling all movie clips that are on lower levels
Hello
I have a movie clip that pops up over all other movie clips.
But it is still possible to interact with these movie clips that
are beneath the mc that has popped up. Is there any way to disable
all of the movie clips that are beneath the one that popped up?
thanksTypically the way to do this is simply create a large
invisible MovieClip which covers everything, and give it a an
interactive event. I often use:
on(rollOver){
useHandCursor = false;
This way not only does it steal interaction from anything
below it, it makes it so the cursor doesn't turn into a hand making
the user think there's something clickable.
You could also make a loop which checks getDepth() and if
it's below a specified depth, set enabled = false, but there's
really no reason in doing that. -
Actionscript 2.0 clear all movie clips
I need to figure out how, when you roll over a movie clip, it clears all previous clips showing and then plays its clip
eh that may not be possible, but what the set up is each tooltip is its own layer with the clips pasted in.
In each clip theres about 5 layers that are involved with the animate. My code to activate it is
on(rollover){
gotoAndPlay(2);}
that triggers the animation. then theres a simple "close" button that just plays everything in reverse. -
TS4455 Why IMovie no longer shows all movie clips from movies from Kodak camera
I am on an IMac 10.6.8 2.16 ghz intel core 2 duo with 3 gb memory
I am using IMovie 11 (9.0.4)
My camera is a Kodak Playsport shooting hd video
On all of over 300 videos I have shot previously IMovie worked perfectly.
On the last 3 movies imported from the camera, I movie loads the preview and I can drag it into the stage but instead of opening up and showing all of the clips, it remains a single image exactly as it displays in the playlist
Nothing I click opens the frames. Thus the only want to edit is to open the file into the fine editing frame
But this is not as easy as it was before where I could see the clip and make the edits right there on the stage.
What has changed? What am I doing wrong?Hello awebstore,
It may be that the view in your Project environment has been zoomed out.
iMovie '11: Resize thumbnail images
http://support.apple.com/kb/PH2121
Hope this helps,
Allen -
How do you wait to load certain movie clips or frames?
I have seen flash sites that wait to load different parts of the flash file until you click on a link, thereby starting a loading graphic that then loads the content you're looking for. I can't find any information on how to do this, and I'm guessing I just can't find the right terminology.
Does anybody have the right verbiage for me or can anybody point me to a website that explains the process? Thanks, DanI got ya. Thanks for your help.
Any idea what size they say is "too big" a file for a flash movie on a standard website nowadays? I'm looking at being around 1MB when all is said and done (assuming I use the loader to pull some of the bigger things from external files).
Thanks, Dan -
Need help loading multiple movie clips.
Hello forum members,
I've run into a bit of an irritating problem and perhaps
someone can clue me in to the answer.
I'm creating a SWF which uses loadMovie (I've also tried
creating a MovieClipLoader instance and using instance.loadClip) to
bring in 2 other SWFs.
See below AS in first couple frames of main movie's
time-line:
First movie:
this.createEmptyMovieClip("mcToolbar", 10);
with (mcToolbar)
_x=8;
_y=68;
loadMovie("toolbar.swf",mcToolbar);
Second movie:
this.createEmptyMovieClip("mcWindow", 11);
with (mcToolbar)
_x=500;
_y=60;
loadMovie("textwindow.swf",mcWindow);
This works great when opening up my main SWF in Flash Player
and when viewing the movie in the published HTML web page.
However, I'm using FlashObject to load my main movie to get
around that annoying "Click to activate this control" thing.
When viewing this version of the web page with my main SWF
being loaded, I see the SWF load, then the first loadMovie
loads....THEN the first loadMovie disappears and the second
loadMovie loads and appears at the wrong X and Y coordinates.
Any ideas?Ok, I know replying to my own post is odd on some forums, but
anyhow:
I've done some further testing and find that FlashObject
isn't the problem.
Looking at the AS code above, it is clear that the SWFs to be
loaded must be in the same folder as the HTML web-page.
However, my intent is that these small SWFs that are being
loaded in by the main SWF will be shared by many other movies,
therefore I'd like to stick them (the physical SWF files) closer to
the root of the site (e.g. SiteFoler->flash).
I see that my problem rears its ugly head when I try to
reference these movies in my main flash movie as follows:
First movie:
this.createEmptyMovieClip("mcToolbar", 10);
with (mcToolbar)
_x=8;
_y=68;
loadMovie("../../../flash/toolbar.swf",mcToolbar);
Second movie:
this.createEmptyMovieClip("mcWindow", 11);
with (mcToolbar)
_x=500;
_y=60;
loadMovie("../../../flash/textwindow.swf",mcWindow);
In the example above, my HTML page is 3 folders deep whereas
the movies I'm loading in are 1 folder deep in the folder labeled
"flash".
By doing it in this manner, I get the problems I described
above (first movie loads then disappears and second movie loads in
wrong position).
Any ideas as to why the physical location of the SWFs being
pulled in is causing this problem? I'd like to try to avoid copying
the SWFs to each place their being refrenced from as that could be
a major maintenance headace.
Thanks,
Ben -
GotoAndPlay - refresh all movie clips.
I am trying to create a refresh button using the following code on a button.
on (release) {
gotoAndPlay(2);
This works fine to return to the part of the timeline I want, however because I am using child movieclips with gotoAndPlay, only the main timeline returns to the start, the child movieclips stay as they were.
Is there anyway of getting the whole movie to return to the start?
Many thanks.you must explicitly return everything to the start state or you can reload your swf:
on(release){
loadMovieNum(_root._url,0);
Maybe you are looking for
-
How to create packages ?
Hello ! I'm trying to create one package with a source file containing all the hierarchy of classes and their dependencies. For example there is class Human, and class Asians, Europeans, Africans, etc... etc... all those classes extends Human. Do you
-
Feature request: brightness of thumbs background
I'm trying the Lightroom 3 Beta, and i must say i'm impressed. I'm considering building my workflow around it. Most of the issues i have solved, but a couple remain. I find that the thumbnail background in the library grid view is too bright in co
-
It's annoying getting seven, eight, ten, twenty direct billings from my bank account when I'd prefer a single one per session. Maybe this isn't possible to do, but it never hurts to ask!
-
How can I pass arguments to a TestStand sequence with LabWindows 6 ?
Hi I have created sequences in a TestStand file. I want to program a sequence with Labwindows 6 which would call all these existing sequences (containing parameters). I don't have any problems to create the steps "SequenceCall" but i don't know how t
-
okaay so my problem is whenever I import a cd into all seems okay until I sync the songs into my ipod. It seems that the first song is always cut off and then it skips to the next song. Does anybody else seem to have this problem? How do I solve this