Well I am afraid I have quite a confession to make when it comes to the fancy graphics. I cannot take the credit for them, as my co-worker was put in charge of them, as he is the best illustrator out of all of us. So you see, all this time I have been referring to my fancy graphics…they are really not quite mine. :-/
I think I have done alright for having no programming bg of any kind…only design. I started this job I am in right out of a two year Graphic Arts program, and have used Flash for about 3 “major” projects and maybe 5 very small things. Should I have told you that before you started helping me?
Remember a while back when we discussed how to go about dealing with the fancy graphics? Well I told you yesterday I was beginning to see how that would go, and this is what I am wondering. Can you set properties of externally loaded swf’s? I think you can only set it for mc’s…maybe I am searching with the wrong words.
I even tried setting visible to false in the empty mc the swf is loaded into, even though I knew that didn’t make sense as it is unseen anyway.
when you load something into an mc,you have to wait until it has finished loading before you can mess around with it.Your idea of making clip1._visible = false was correct but the code executed before the movie loaded.
try something like this
function loader(clip) {
if (clip.getBytesLoaded()>=clip.getBytesTotal() && clip.getBytesLoaded()>1) {
clip._visible = false;
clearInterval(myInterval);
}
}
createEmptyMovieClip(“clip1”, 1);
loadMovie(“test.swf”, clip1);
myInterval = setInterval(loader, 50, clip1);
There are other ways too but see if this works ok for you.
Ive just finished making a file for someone else who wants to use loadvars for something similar yet simpler.You can ignore the loadvars bit but if you have time, have a look at this file to see a different way storing questions answers etc all in one array. If you delete the line barray.sort(shuffle); and when you test the movie have a look at the variables, youll see how it is structured.(problems uploading -uploaded in a couple of threads)
Hey Stringy thanks for the info. I least I was sort of on the right track =)
I think something happened with your attachment, the fla comes up empty and the swf does not really do anything except say game over after clicking a couple of the buttons.
Well anyway, I did get it open and have a look at it. Your earlier code for hiding the swf loading into the emptymc did work by the way. Now it is a matter of having that set up the same way the questions are but including making the empty mc for each and hiding them until needed. It would be similar with each having an ivar, to find it in the array etc… right?
The example, I did look at it. You think that I should attempt having everything stored within one array? Your outlook on this would be better than mine.
yes you have got the right idea.its actually possible to load them all sequentially but then if a user chooses a question while loading then the order change and that “fancy graphic” will load first.Probably better just to see how you get on. You only need the one function to make invisible,maybe put all the swf¬s into an array and loop through that.
I think the one array idea is better but most of the work is done on yours. Also yours is more complex so might get confusing. Just thought you might be interested.
It’s not that I am not interested…just afraid to change things that are already working.
Oh I meant to ask, what is the purpose of setInterval when loading and hiding the fancyartwork.swf’s?
I do look up the definitions in the Flash Help AS dictionary but sometimes cannot make the leap to how it applies with a specific block of code…
“Action; calls a function or a method or an object at periodic intervals while a movie plays. You can use an interval function to update variables from a database or update a time display”
its just an alternative to onEnterFrame
The above calls the function loader every 50/1000 seconds each time checking if it has loaded.when loaded the interval is cleared and it stops.
same code as i use for preloaders.
and this is a good alternative because it keeps checking (to see if the swf is loaded) and stops checking once it is loaded as opposed to just simply loading and that’s it?
my boss was just at my desk…and guess what? there may be changes to the outcome of the game! ah well at least it would affect things that have not yet been set…
anyway I hate to disappoint you, but I will not be bothering you at all for an entire week…when I leave work today I am going “on holiday” and will not be back until the next Monday. yay for me :pleased:
and yay for you :pleased: what will you do with the time that you are not solving all my problems for me…
if you used onEnterFrame to check, you would simple delete the onEnterFrame once the clip is loaded.
It will be like a holiday for me too :lol:
i have tons of things to do at home
Have a nice time