Problem in MovieClipLoader
Hello guys
Iam using the MovieClipLoader object to load multiple jpg
images by getting their names from a xml file but agfter a minute
or two images are disappearing.In other words I can still get a
hand cursor by rolling over them but I cant see them,please guys
help me with this problem.here is my code:
for (i=0;i<10;i++)
{_root.attachMovie("Movie","Movie"+i,i);
_root["Movie"+i].createEmptyMovieClip("Clp"+i,10*i);
var mcloader:MovieClipLoader=new MovieClipLoader();
mcloader.loadClip("Folder/"+xml_var+".jpg" , _root["Movie"+i]
["Clp"+i]);
you're repeatedly destroying mcloader with each loop
iteration (until the last).
to remedy, remove your mcloader instantiation statement from
the for-loop and insert just prior to your for-loop.
Similar Messages
-
FullScreen problem with MovieClipLoader
Hi and thanks very very much for reading.
My problem is: When I load a .swf via MovieClipLoader in ActionScript 2 -- Stage["fullScreen"] no longer works. I am stuck in "normal" for the Stage.
If I run the loaded SWF without the preloader, then everything works fine and I can get to fullscreen mode. So it seems the problem has to do with the preloader.
I am using loadMovieNum("FSTest.swf",0) to bring the loaded clip to Root level. Thought that would solve my problem but it doesn't.
Here is some test code that demonstrates my problem. You can see it run at: http://www.tommygameco.com/TestLoader.html
TESTLOADER.FLA: (preloader)
var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
var FS_mc:MovieClip = container.createEmptyMovieClip("FSClip", container.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
var interval:Object = new Object();
listener.onLoadInit = function() {
// make loaded movie _root
loadMovieNum("FSTest.swf",0);
mcLoader.addListener(listener);
mcLoader.loadClip("FSTest.swf", FS_mc);
stop();
FSTEST.FLA: (Loaded Movie)
fsbutton.onRelease = function() {
Stage["displayState"]="fullScreen";
stageState.text = Stage["displayState"];
Thanks again!! Any Clues are greatly appreciated!!!
TomHi,
Problem was in the publish settings --- My loaded clip was set for "allow full screen" under publish options (file Menu, HTML Tab). However the Pre-loader was not!! Fixing that fixes the problem.
Best Regards,
Tom -
Problem Loading Gif's using MovieClipLoader
Hi forum,
I am using the MovieClipLoader to load images into a web
site. some are jpg's some are gif's. Now the problem is that jpg's
load properly and appear on the stage but gif's don't load...(well
at least they don't appear on the stage)
I know MovieClipLoader doesn't load animated gif's (as
mensioned in the help file) but I have created those gifs in flash
and non are animated, they are all just one frame image.
So can anyone tell me what am I doing wrong.
Here is the code:
P.S. I'm exporting for player 7 and I need to keep it that
way.
if I decomment the last line of code the jpg image loads and
appears on the stage.
Many thanks in advance.has981,
> I know MovieClipLoader doesn't load animated gif's (as
> mensioned in the help file) but I have created those
gifs in
> flash and non are animated, they are all just one frame
image.
Actually, MovieClipLoader does load animated GIFs -- they
just don't
animate once loaded.
> if I decomment the last line of code the jpg image loads
> and appears on the stage.
> Many thanks in advance.
You code looks absolutely fine to me. I tested it right here
with a GIF
and a JPG. You're doing this in Flash 8, right? Prior to 8,
Flash only
loaded non-progressive JPGs and SWFs (and earlier, only
SWFs).
David
stiller (at) quip (dot) net
Dev essays:
http://www.quip.net/blog/
"Luck is the residue of good design." -
Problem with CheckBox and MovieClipLoader
I am using the MovieClipLoader and it was working great,
until I load one of my sections which has a CheckBox in it. Once I
load that section, the MovieClipLoader is not working correctly
anymore. Anyone have experience with this? What can I do?wow, that fixed my issue! I can't believe that is all I
needed.
Thank you so much KGlad! I don't know what I would do without
your help! -
MovieClipLoader - bytesLoaded problem
I am trying to create a preloader to load multiple swf files
from an XML file. I was able to add the bytesTotal of the files
together to get a cumulative bytesTotal and now I need to do the
same for the bytesLoaded... the problem is that the files load in
parallel so getting the bytesLoaded in the onLoadProgress state
gives me a bytesLoaded number that is WAY larger than my
bytesTotal.
Any idea how I can get the bytesLoaded for each movie and add
them into a cumulative bytesLoaded variable? Code is attached.
Thanks!
- Aaron
-------------------- Code
---------------------------------------It's getting there! Thanks for the example... now... why is
totalLoaded exceeding totalBytes by a large amount? Shouldn't
totalLoaded equal totalBytes when it is finished?
Also, it seems that the totalLoaded amounts are broken out
individually for each file... how can I add these amounts up into
one totalLoaded for all the files that I'm loading? -
Problem with the FOR statement.....again!
Hi everyone,
Well I'm still trying to do a car slideshow using external
files and can't seem to see the end. The current movie is here:
http://www.virtuallglab.com/projects.html
I also attach the code. My problem is I had originally set up
an animation with 2 pictures sliding in with some text, and then
wait 4 seconds before sliding out, and then next pictures and text
would slide in and so on, using a setInterval.
The problem is the FOR loop seems to skip the setInterval and
the function "wait", so it just loops quickly and jumps to last
picture, so on the example above, it just slides the last picture
(i=9) and that's it!
Can you not include another function within a FOR statement.
Or is there a way to tell the FOR loop to wait until all motion is
finished?
Any help greatly appreciated
import mx.transitions.*;
import mx.transitions.easing.*;
for (i=0; i<10 ; i++) {
var picLeft = "pics/"+i+".jpg";
var picRight = "pics/"+i+"b.jpg";
var txtToLoad = "text/"+i+".txt";
this.createEmptyMovieClip("leftHolder",1);
leftHolder.loadMovie(picLeft,i,leftHolder.getNextHighestDepth());
leftHolder._x = -200;
leftHolder._y = 15;
var leftTween:Tween = new Tween(leftHolder, "_x",
Strong.easeOut, leftHolder._x, 10, 2, true);
this.createEmptyMovieClip("centerHolder",2);
centerHolder.loadMovie(picRight,i+"b",centerHolder.getNextHighestDepth());
centerHolder._x = 180;
centerHolder._y = 250;
var centerTween:Tween = new Tween(centerHolder, "_y",
Strong.easeOut, centerHolder._y, 15, 2, true);
text._x = 600;
myData = new LoadVars();
myData.onLoad = function(){
text.carText.text = this.content;
myData.load(txtToLoad);
var textTween:Tween = new Tween(text, "_x", Strong.easeOut,
text._x, 420, 2, true);
myInterval = setInterval(wait, 4000);
function wait() {
var leftTweenFinished:Tween = new Tween(leftHolder, "_x",
Strong.easeOut, leftHolder._x, -200, 1, true);
var centerTween:Tween = new Tween(centerHolder, "_y",
Strong.easeOut, centerHolder._y, 250, 1, true);
var textTween2:Tween = new Tween(text, "_x", Strong.easeOut,
text._x, 600, 1, true);
clearInterval(myInterval);
***************************************************************************************** ***There is no way to tell a for loop to wait. That is not what
they do.
The entire for loop will execute (if possible, and it doesn't
enter some kind of continuous infinite loop) completely before each
time the frame is rendered.
If you want to spread things out over time you need to use
the setInterval -- but not inside a for loop! If you do that you
immediately set however many intervals as your loop has. In this
case you will also assign the ids for those intervals to the same
variable, effectively overwriting the value so you will never be
able to clear most of those intervals.
So you need to rethink you whole structure. Set up some kind
of counter and limit like this:
var slidesToShow:Number=10;
var curSlide:Number=0;
Then have your setInterval increment the curSlide each time
it is called and check to see if it has shown all of them. That is
where your "loop" comes in.
As for the other part of your question -- yes you actually
have two different issues going on -- again you cannot make a for
loop wait for anything. So no there is no way to pause it while you
wait for your tween to end. But you can be notified when a tween
ends.
Check out the documentation about the tween class in the help
files. There you will find the onMotionFinished event. So you can
set up one of those to start whatever needs to be started when the
tween has finished.
You should also use the MovieClipLoader class to load your
images, because you have no idea how long it will take to load
them. Using that class you get a nice event (onLoadInit) that tells
you when the asset is ready to be used.
Finally I'm thinking you might want to use setTimeout instead
of setInterval. It only goes once, while setInterval repeats
forever. So I would think your algorithm would be something like
this.
1. load external asset
2. when ready animate in and set onMotionFinished handler
3. when motion is finished start loading next asset and
setTimeout for 4 seconds.
4. when 4 seconds is up or the clip is loaded (which ever
takes longer) go to 2 and repeat.
If this is going to be run locally on a hard drive or CD you
won't have any problem with the length of time it takes to load the
external assets, but if it is over the web it will take time. -
Hello.
I am having a weird problem when trying to test a movie or publish preview -> flash on mac with Leopard os.
The result is a blank movie with the usuall "movie not loaded" if u right click on it and the output returns the "Error opening URL 'the path of the swf here'.
This has nothing to do with loading external files or something like that. It happens even in blank movies and it gives the same error if I try to open a swf from flash ide.
I can publish the project or export the movie with no problem at all.
I can preview the movie in html. I can run all the swf files in my hard disk, network, usb stick, dvd etc., but when I try to open any of these files from flash ide I got that stupid error.
Its not something that stops me from working in flash ide but its slow to export movie any time I want to test it.
Things that I've tried so far but nothing worked:
Update the flash cs4 to the latest version
Update the flash players
Restored the release flash player as default player (I am using as default the debug player)
Cleared the preferences
Move the flash cs4 folder to another location in hd
Saved the fla document first before testing the movie (in different places with or without spaces in document name or folder)
Give read & write permissions for everyone for flash.app, players and for fla files when saved first before test movie
Unistall and install the application 3-4 times.
Test every as version just in case.
Also I've checked the folders when testing movie and I can see that it creates an swf file, which I can run it outside flash ide (the one that the flash ide player cannot load) with no problem.
The mac os has the default set up as it came. Nothing chnaged in permissions or security settings.
Thanx in advance.In this particular example I am using this code to start the
xml file load:
// now load the XML file that contains the content strings
var sXMLFile:String = "xml/home.xml";
var xmlContent:XML = new XML();
xmlContent.ignoreWhite = true;
xmlContent.onLoad = onXMLLoadComplete;
xmlContent.load( sXMLFile );
But I don’t think the code is the problem here . This
happens on every file I load when I am using a relative path to the
content, regardless of how I load the content (XML object,
loadMovie, MovieClipLoader, etc…) and the same code executes
perfectly on every other machine in the office(Mac and PC).
I’m more concerned with the semi-colons and .swf filename
that Flash is putting into my relative path on the error message.
Is that normal? -
Loading an external swf problem
Hi everyone,
I have started a new project for a client that wants a
shopping cart that works through PayPal in his flash site. I have a
working shopping cart at
http://www.flypapercreative.com/flashshop.html
. Some things need to changed but it is working.
I am using the code below to load the shopping cart into my
main movie. I have made an empty movie and gave it an instance name
of "myContainer" and set it up in my time line. You can find my
main flash movie at
http://flypapercreative.com/olc.html
myContainer.loadMovie("oregonLoveCoStore.swf");
Both carts are reading off the same swf file. This is just a
guess but maybe it is not reading code or instance names that are
not on the main timeline.
Anyone know a different way to load my shopping cart swf file
differently that might fix the problem?
Thanks,
Chrisuse the MovieClipLoader class. F1 for help docs in
Flash. -
Progressbar and loader problem with IE
Hello there,
well, in my project i have been using the loader and the
progressBar components. (actionscript 2).
the loader and the progress bar placed on the "main.swf" and
its loading an external ".swf's". I am a mac user, so i was testing
the movie on "fireFox" and on "Safari" everything is working well.
but, when i was viewing it on "Internet Explorer" any of the
progress bars didn't appeared and the functions that relates to the
"on(complete)" state, doesn't happen.
if anybody recognize this problem, please leave me directions
to solve this. so frustrating. thanks allot, asi.I can confirm this seems to be a problem for me also. I have
used multiple instances of the Loader component in various sites
recently (AS2) and they all have issues in IE7. I managed to narrow
one problem down to the fact the .progress listener wouldn't work.
I'm having to rip out all instances of the Loader component
and replace it with the MovieClipLoader class as a fix until
someone can shed some more light on this... -
I looked up MovieClipLoader tutorials and finally came up with the code:
var myMCL:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
myMCL.addListener(loadListener);
loadListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void
var perc:Number = (bytesLoaded / bytesTotal) * 100;
prcnt.text = perc + " %";
loadListener.onLoadInit = function(target_mc:MovieClip)
trace( target_mc + " finished loading so display on screen now. " );
prcnt.text = "init";
loadListener.onLoadError = function(target_mc:MovieClip, errorCode:String, httpStatus:Number)
trace( "error loading image : errorCode : " + errorCode );
loadListener.onLoadStart = function(target_mc:MovieClip)
trace( target_mc + " start loading. maybe you want to do something here? " );
prcnt.text = "onstart";
myMCL.loadClip("filename.swf", mcholder); //mcholder is the movie clip holder placed on stage manually
The problem here is that the file does not move beyond printing this:
_level0.mcholder start loading. maybe you want to do something here?
_level0.mcholder start loading. maybe you want to do something here?
_level0.mcholder start loading. maybe you want to do something here?
_level0.mcholder start loading. maybe you want to do something here?
_level0.mcholder start loading. maybe you want to do something here?
_level0.mcholder start loading. maybe you want to do something here?
_level0.mcholder start loading. maybe you want to do something here?
Why is this happening? The code is directly from the tutorial. I have included all event functions, in case they are something like abstract functions, I don't know if this is required or not. I know I must be being a pain, but no one seems to be answering my question. I can't figure out what is wrong with the code, seems simple enough to me. I am sure I am missing some basic point. Any help will be greatly appreciated...it could be that the code in that frame is repeatedly executing. ie, that frame is part of a frame loop.
to remedy, add a stop() to your code. -
Note to Adobe: Noticing much more problems?
I wanted to post an honest discussion with someone from the
Adobe Flash team just so we can guide the future of Flash for
version 10. I know it's still early and a long way from that as
most of us battle with our AS3 migration, but I wanted to add my
two cents for an honest discussion. I am hoping some honest Adobe
Flash team members can engage us in this as well.
First of all, I have been a Flash designer / animator /
programmer / teacher since Flash 2. Macromedia bought FutureSplash
and released Flash 2. I have been with it all the way and love it.
It has always been the best tool for me as a visual person who
loves to put things together. It allowed me to be both designer and
programmer. I have always loved it even with the difficulties of
some of the progression of ActionScript such as the move to AS2.
But I have to say the AS3 migration from those who have been
in the Flash camp for along time leaves me baffled. I understand
why AS3 is completely new. It has to leverage Flex and had to be
built around a whole new Virtual Machine in the player. I am amazed
with what the team has been able to accomplish; however, the
differences between AS2 and AS3 are too different and haven't
properly been structured and documented from the designer's
perspective. Designers pushing the boundaries of what Flash could
do is what made Flash a popular player in the browser. Each step of
the way designers have had to make way to programmers coming over
from other languages. I have no problem with that, but each step
takes things away from designers and animators in order to give
programmers their way of understanding. This is a slap in the face
to those who have helped make Flash a truly universal product. I
don't think any designers have a problem with programmers jumping
on board, but things shouldn't have been taken away along the way
for those who were very comfortable with the Object Orientation of
Flash as it was. Flash has always been Object Oriented. Remember
when Macromedia took away "Normal" vs "Expert" scripting mode and
how pissed some people were? The change to AS3 makes that look
juvenile.
The reason I start this thread is not to attack Adobe. I just
would like to start a good discussion to see if we designers can
add something to the next round since things have been taken away
from us. I give you this example. The foundation of good Flash
projects (not gaudy long intros....I mean honest, well-thought out
projects that preloaded some parts and got ready to play with
enough data) was usually built around loadMovieNum. The analogy of
levels and layers was the foundation of every good solid project.
That has since been replaced with the DisplayObject.addChild();
functionality which is fine. I am not questioning the usefulness of
that. However, the exact foundation of all versions of Flash up to
version 9 has now been taken away. Can someone from Adobe answer
why things were taken away? Also, can a similar analogy be
implemented into Flash v10? If not, why not?
Any other examples anyone else wants to list? Go ahead, there
are plenty.
Once again I will state that I have no problem with AS3 and
willing to learn it. Most of my projects are being converted and
new projects are built around it. I just find it silly that I can't
simply build a class that tells the main timeline to simply play();
using root or parent as a timeline itself. What Adobe has forced
the long-time users to do is move backward and learn their product
all over again from scratch by taking things away thereby canceling
the years of experience that we all gained since 1997.
Have there been any discussions at Adobe about how to help
bring designers back into the discussion of Flash and how best to
ensure the Flash IDE maintains its visual approach for those who
choose to work that way?
There are many more points I can discuss but I don't want
this to be any longer than it needs to be. And I know there will be
many programmer types who don't understand and try to flame me. I
just hope there is an honest discussion of how to ensure the
knowledge built over the years does not have to be fully
abandoned.RDcollege,
I'd like to echo bnailWedge's encouragement to keep your
chin up. I
don't think your post sounds like an attack, which (to my
thinking) is a
great way to invite constructive input and useful discussion,
so let's see
who else weighs in on this thread. :)
We all come from different backgrounds, so it's hard to give
assurances
to everyone. Personally, I came to Flash with an English
degree, a love for
multimedia, and enough natural artistic talent that the
notion of a Flash
career wasn't patently out of the question. ActionScript was
difficult for
me at first, but I wanted so badly to make things bounce
around -- without
the constraints of the timeline -- that I was bewitched into
trying again
and again (and again and again) until, after years, concepts
started falling
into place for me.
I'm enough of a nerd (ask my wife!) that, somehow, I've
managed to teach
myself programming to a degree that I now consult and develop
full time. As
a kid, I wouldn't have thought I'd be a programmer one day,
but I'm glad
things have turned out as they have, because programming
helps me accomplish
what I want from a design standpoint. I remember what it was
like to learn
this stuff -- as Macromedia kept rolling it out! -- and that
helps me
empathize with your post. I'm not a computer science
graduate. I don't
have any background with Java or C, which means I'm not the
sort of person
at which Flex is aimed. I like Flex Builder well enough, I'm
still firmly a
Flash dude, and I don't see myself changing.
I remember when Flash MX 2004 dropped Normal Mode, and I
remember the
outcry. I also saw that feature resurrected (in somewhat
different form) as
Script Assist in Flash 8. It's still present in Flash CS3,
just not as
useful (my opinion) when used with ActionScript 3.0. But
frankly, how many
people truly put together a complex project -- like you were
saying,
"honest, well-thought out projects that preloaded some parts
and got ready
to play with enough data" -- in Normal Mode? Complex projects
get easier, I
think, when you can type the code in yourself.
> I just find it silly that I can't simply build a class
that tells the main
> timeline to simply play(); using root or parent as a
timeline itself.
This part piques my interest, because the main timeline in
an
ActionScript 3.0 document is, by default, a subclass of the
MovieClip class.
You can optionally write your own document class to extend
Sprite instead,
but as a MovieClip instance, the main timeline indeed
responds to movie clip
methods such as play(). Can you provide more detail?
One of the examples I generally discuss when talking about
AS3 is the
way event handling has been simplified. Prior to AS3, there
were a boatload
of ways to handle events, everything from on() and
onClipEvent() to their
dot notation replacements (onRelease = funtion():Void {}), to
addListener()
(Stage, MovieClipLoader, Mouse) to addEventListener
(components). To
someone growing up on Macromedia, each new approach was a
relatively small
tool/burden to add to the arsenal -- but to new a newcomer
... good heavens!
Why should there be so many? Which approach to use where? In
AS3, almost
eveything (with very few exceptions!) is addEventListener().
Colin Moock wrote an article recently that speaks to this
topic and made
a lot of sense to me. I think it may give you some
encouragement.
http://www.insideria.com/2008/01/actionscript-30-is-it-hard-or.html
For what it's worth, I'm working on a new title for O'Reilly
that's also
aimed at this topic. I wouldn't be surprised at all if other
publishers do
the same. As kglad mentioned, you can always submit to the
official feature
request form.
> Any other examples anyone else wants to list? Go ahead,
there
> are plenty.
When you mentioned this, you were referring to levels and
layers, hoping
a similar analogy would be implemented into Flash CS4. Levels
are gone in
AS3, true, but even during the loadMovieNum() days,
loadMovie() allowed for
content to be loaded into a movie clip instead. To me, that
puts the idea
of movie clips and levels into the same category (and in a
sense, they were
the same thing). Is that really so different from the current
display list
metaphor? The display list is still hierarchical. Layers, of
course, are
still present in the Timeline panel, so those haven't
changed.
If you list other specifics, I'll be happy to discuss them.
Not sure if
I can make them seem useful, but I'll try. :)
David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design." -
AS2 Question/Problem..
I have a swf where I'm calling two external swf files. These external swf files also load data from an xml file. The problem is that the first external swf file that I load is the only one that loads. Well.. the other swf does load, but it loads the first xml file loaded. I've tried adding each swf to their own frame and holder, then unload.. still no luck. I can run my swf, click the button to load mc1.swf and it loads fine. I then click the button to unload mc1/load mc2, but the xml data form mc1 is loaded. If I close the player, and launch mc2, it loads fine, but now mc1 will not load!! AGG.. this is driving me crazy.
Here's the file structure I'm using:
root/files/main.swf - my swf file that loads the other files
root/files/mc1.swf
root/files/mc2.swf
root/files/mc1data/info.xml
root/files/mc2data/info.xml
The thing is I can't change the path, or file name for mc1/2's xml file, as I don't have the source.
I really appreciate all the assistance I can get.
TIA!!that's not the path used by the swfs. when you run one of the swfs by itself (without loading it into another swf), what path is used to retrieve the xml?
and here's the code you should be using:
stop();
this.createEmptyMovieClip("image_mc",this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc._width = 800;
target_mc._height = 400;
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
function loadSWFFile(which:String) {
image_mcl.loadClip(which,image_mc);
btn1.onRelease = function() {
loadSWFFile("mc1.swf");
btn2.onRelease = function() {
loadSWFFile("mc2.swf"); -
I know there's a million posts about this topic (believe me,
I've been through most of them) but there is nothing that seems to
fit my problem. No matter what I do, I cannot get my external swfs
to load into the main swf of my project. I know the key pretty much
lies in the MoveClipLoader class, but I'm also fairly certain that
I'm missing something very important which would and should not
come as a suprise. This is the code I am using in my main swf:All of my SWFs are in the same folder, but using the absolute
URL made everything fire correctly. Thanks for the help. I do have
another question, though. I've been working under the impression
for some time that you only need to have your files in the same
folder and then just make reference to them. Is this not the case
or is it something specific to the MovieClipLoader class? -
Problem using string to store evt.target.data and apply property filters
I have about 9 buttons on my stage and I want to write code for the rollover and rollout effects, I only want to write the code once so I am trying to pass the button info into a string via evt.target.data and it pass the info properly into my string variable but when I try to set my filter to that variable, setting my movieclip instance name to that variable, I get 2 errors:
1119: Access of possibly undefined property filters through a reference with static type String.
Warning: 1072: Migration issue: String is not a dynamic class. Instances cannot have members added to them dynamically.
My code is:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var thumbArray:Array=new Array();
var movieClipLoader:Loader;
var movieClipsStage:Array=new Array(mc0,mc1,mc2,mc3,mc4,mc5,mc6,mc7,mc8);
toolTip_mc.alpha=0;
var lumRd:Number=.2127;
var lumGr:Number=.7152;
var lumBl:Number=.0722;
//grayscale
var grayscale:ColorMatrixFilter = new ColorMatrixFilter([lumRd, lumGr, lumBl, 0, 0,
lumRd, lumGr, lumBl, 0, 0,
lumRd, lumGr, lumBl, 0, 0,
0, 0, 0, 1, 0]);
//drop shadow
var ds:DropShadowFilter = new DropShadowFilter();
ds.distance=5;
ds.blurX=10;
ds.blurY=10;
ds.alpha=.7;
//varialbe to store movieclips based on rollover
var whichThumb:String;
var myXMLInfo:XML;
var thumbList:XMLList;
var toolNameList:XMLList;
var myXMLLoader:URLLoader=new URLLoader ;
myXMLLoader.load(new URLRequest("stars.xml"));
myXMLLoader.addEventListener(Event.COMPLETE, loadComplete);
function loadComplete(evt:Event):void {
myXMLLoader.removeEventListener(Event.COMPLETE, loadComplete);
myXMLInfo=XML(evt.target.data);
thumbList= new XMLList();
toolNameList=myXMLInfo.star.@toolname;
thumbList=myXMLInfo.star.@thumbimage;
for (var n:int=0; n<movieClipsStage.length; n++) {
movieClipLoader=new Loader();
movieClipLoader.load(new URLRequest(thumbList[n]));
movieClipsStage[n].addChild(movieClipLoader);
mc0.filters=mc1.filters=mc2.filters=mc3.filters=mc4.filters=mc5.filters=mc6.filters=mc7.fi lters=mc8.filters=[ds,grayscale];
mc0_bu.addEventListener(MouseEvent.ROLL_OVER, thumbRollEffect);
function thumbRollEffect(evt:MouseEvent):void {
whichThumb = evt.target.name;
whichThumb.filters=[ds];
Thank you for your help!kglad, thanks for helping.
basically, i am a newbie and i'm not clear on your answer . if evt.currentTarget is better, I would like to use the best method, so thanks. i'm trying to get my head around what's going on here in the code. i get that actionscript is storing a "reference" to the object but I don't get why I can't put that reference (which is the name of the movieclip on the stage I wish to apply filters to, i.e. mc0) into a string variable (whichThumb) and then use that string variable to apply the filter (whichThumb.filters=[ds];)
on one hand, i'm getting error that says "possibly undefined property filters thru a ref with string" which I don't get because the filters are defined outside of the function and are called intially in the load function with no problem. and on the other hand, i am getting another error saying there is a "migraiton issue" with my string not being a dynamic class. do i need to make the var whichThumb another type other than string? if so, what type. maybe that will also solve the "undefined property" issue as well.
still learning, Thanks for help! -
MovieClipLoader height and width
Hi all,
ok, situation is this...user clicks and drags a rectangle on
the stage which gets created into a Loader which they can then load
an image/swf into using filereference upload.
Depending on the size and position of the rectangle the user
has drawn, will depend on the size of the movieclip, as a resizer
handler works out the scale of the object loaded and resizes it in
proportion. This works fine if it's something like a jpg however,
not with a swf. The problem is that when loading a swf in it only
looks at the size of the movie IN THE FIRST FRAME! So _height and
_width are incorrect when the swf is loaded in.
For example, create a 50x50 box in the top left of a 550x400
stagesize flashmovie and tween it over a few frame to the bottom
left and save and publish the movie. Now in a new movie create a
moviecliploader and load in your tween movie and set a onloadinit
listener to output the _width and _height. it will say 51 and 51
(not sure why the additional pixel) NOT 550x400.
As such, the entire scaling and any subsequent resizing the
user can do doesn't work properly. In this example, it would resize
the 51 x 51 movie to proportional fill the 550x400 space, so you'd
end up with a 400x400 square that will tween off the screen, as
it's actually resized it to 4400 x 3200 !
The only way I can find of getting round it is to put an 0
alpha moveclip the size of the stage on the clip to be
loaded...which seem a bit of a hack.
Any idea how I can get round this with AS?Those numbers are the Stage.width and Stage.height. In the
IDE that is Menu Modify->Document.
Only the first loaded swf Stage height and Stage width
survives. The first loaded swf becomes a mask for any other
external swf loaded into it.
When you load an external swf into a Movieclip, the external
swf is loaded but its Stage data is lost and it only loads what is
compatible inside a MovieClip.
MovieClips have a dynamic changing _height and _width
property depending on the frame and the object positions on that
frame.
If you need a first frame that is always a certain size, then
include a rectangle MovieClip with an alpha = 0 on the first frame.
If all frames, extend to all frames but remember any objects that
move beyond that change _width and _height..
Maybe you are looking for
-
Earpiece,speakers and microphone is not working du...
Plzz help me...i bought my Lumia 630 4 days ago. .All things are going fine but today during a call I cannot hear any voice with earpiece,headphones or speakers...And another person too is not able to hear any voice...
-
How can I edit or remove iWeb pages from Mobile me after I have published it to another site?
I have published iweb pages to another server and now I need to replace the mobile me version with page "pages moved to..." or at least I need to delete old version. However I can't find any way to do this from mobile me or from iWeb. From Mobile me
-
Finding open source/GNU free software projects
I am looking to work on an open source or GNU free software project. So far I have found three places to shop: 1) jakarta 2) gnu.org 3) sourceforge Are there any other major projects? I have an MSEE and 10 years C/C++ UNIX-centric, server-centric dev
-
I received this error message AppleUSBethernetHost.Kext help
I received this error message stating that the AppleUSBethernetHost.Kext file is corrupt on my Mini Mac stating that I need to reinstall this file can someone please help me as to what to do to fix this problem. Thank you, Don in Port Dover
-
Credit Limit Check - Value & Periodwise both at the same time
Dear All, This problem is related to Credit Management.I want the system should carry out a check which will take into consideration both the value and credit limit days while punching a sales order. For Example : Party : A Credit Limit : Rs. 1000/-