milosav, can you have a different fps rate for swfs loaded into the main movie? i tried to pm you but i couldnt figure the pm's out.
thanks
aaron
Printable View
milosav, can you have a different fps rate for swfs loaded into the main movie? i tried to pm you but i couldnt figure the pm's out.
thanks
aaron
hi aaron
you cannot, no. the frame rate, background colour and frame size are all set by the main or level0 movie.
thanks a bunch
Hi justplainsoccer,
As julianthomas says no they are set by the base movie.
But.... maybe what you want to do can be done independant
of any frame rate. If you do not use the timeline then
you are not so stuck with the frame rate.
ie:
Flash MX.
//an event every 10 milliseconds aprox 100 fps
animation1_Interval=setInterval(animate1,10);
//an event every 85 milliseconds aprox 12 fps
animation2_Interval=setInterval(animate2,85);
//animation at 100 fps
function animate1(){clip1._x+=1;updateAfterEvent();}
//animation at 12 fps
function animate2(){clip2._y_=1;}
I have effectively created 12 fps animation and
high grade 100 fps animation not only in the same
movie but all in one frame !!!!!!!!!!!!!!!!!!!!
You can do a lot with actionscript...
So your .swf file frame rate says no but don't let it
stop you trying. Using setInterval is a great way to do higher
grade animation within a low frame rate .swf.
Milosav
Hey Milosav,
I'm back.
I have some questions about the random movie example you made for me.
1. In the script, it looks like you created the blank movie clip right there..its not even in the library..is this what you did? If so, why did you take this approach rather then just make an empty movie clip in the library?
2. The random button that plays in mainMovie.swf - where is this? I can't find it in the maindMovie.fla file.
Can you shed some light on this? Thanks and happy new year!
:smoov:
Hi Foochuck,
Nice to have you back.
Yes well it seems I did not upload the correct mainMovie.fla
for the random movies. So there was no button.......
Here is the correct MainMovie.fla with the button ......
As for using createMovie() instead of hardcoding it from the
library. It is a very good method to use as you can create
complex movies dynamicly. ie:
You are creating a space envionment.
It would be a lot of work if you had to place 200 astroids
manualy from the library position them on the stage ...
give each one an instance name ....
example:
for(i=0;i<50;i++){createEmptyMovieClip("astroid"+i ,i);}
for(i=0;i<50;i++){
this["astroid"+i]._x+=10;
this["astroid"+i]._y+=7;
}
However you must be carefull that the empty MC you have
created are instantiated before you use them. So I would
usualy create them on one frame and manipulate them on
frame 2. Of course there are other methods you could use
but this is convienient.
Happy new year
Milosav
Milosav,
The mainmovie.fla you last posted doesn't work. The button isn't a button and the random movie doesn't work...
Hi Foochuck,
Well ... I hope this is not the general trend of the
new year
I must have not saved the .fla file after I had worked on it.
So here is a new .zip file ... it also includes the external
.swf's.
Sorry about that.
Milosav:(
Hey guys!
I've been reading thru all the examples that you have posted (Milosav you are one busy person!) and I think I have a problem that hasn't been covered. I have searched and seached and cannot find one relative link to the problem I am having...so here it is.
I have a menu flash movie on _level0, and from that main menu it will load another Flash movie onto _level5. When the movie on _level5 loads in you can see the preloader wth no problems whatsoever. Now inside this loaded movie on _level5, I have another menu that allows you to load a different movie onto that same _level5.
The problem lies in that when the newly loaded _level5 replaces the old movie that was in _level5 you get a "flash" of the main menu that is still on _level0 below. I want the preloader that is in this newly loaded movie to show up on the current _level5 until the movie has loaded...and not get a "flash" of _level0 when it loads.
I have tried doing swapdepths etc...and I just can't seem to get this to work. Any suggestions would be GREATLY appreciated!
Cheers!
Hi orangewhip,
I am pretty sure that your problem is that when you
load your new .swf into _level5 ... it replaces
(this is how flash works) everthing that was in _level5
before.
I do not know the exact timing of when the new .swf is
instantiated on _level5, but when it is everything that
was in _level5 will be gone (graphics and actionscript).
Some flash developers say that 10% of the new .swf file
needs to be loaded before you can access it's properties
(ie. _x _y _alpha) so going on this as a guide. When 10%
of your new .swf file is loaded into _level5 everything
that was on _level5 will be gone.
When the content of the new .swf file will appear on _level5
will depend on what is loading (and your setup)
. ie. if the First frame of your new .swf had a large 50Kb graphic you would not see anything until this graphic object appeared
on the timeline of _level5.
Without knowing your setup that's all I can offer.
Where is the preloader script that loads your the first .swf
into _level5???
Where is the preloader script that loads your second .swf
into _level5???
Where is your preloader???
It is more than likely that altering your preloader script
etc. will not help ... the fact is that there is a lag between
the time that _level5 is emptied by the loading of the new
content and the time when the new content will appear. This
I think is causing your "flash" of the mainMenu. I tested your
scenerio on the web before posting this. I tested it loading
108Kb .swf's into _level5 (with the preloader script in the
main Movie on _level0 and my preloader bar loaded into
_level6) the content of _level5 was erased in fractions of a second ... revealing _level0. The new content did not cover
_level0 for quite some time as I had a 108K image in the
first frame of the new .swf.
Have you considered loading into a different _level or into
a Movie Clip instance.
Once loaded all your content will not need to be reloaded
again. and you can just switch between content using very
simple actionscript.
Anyway let me know if you would like to try this approach.
Milosav
Hey Milosav,
I have preloaders on each of the movies that are being loaded in, and they trigger a "loading" animation that is loaded from a swf onto level20.
I know I can load movies into higher levels but with the end user being able to continually select menu items I don't want the menu's being added on top of each other forever.
I think the solution is to duplicate or load a 2nd version of the current open level onto a level below it. So that when the current level is changed....there is another "version" of it under it immediately...
I have tried and tried to get it to duplicate or load a second version of the same movie under the current one, and it doesn't seem to work too well for some reason.
I have attached a little demo that I was trying to get to work. Basically you have a main movie with a function on frame 1. A menu gets loaded into a level on top of everything else (so that the loaded swfs don't cover the menu up) Each button in the menu calls the function to load a different movie into level0 - depth 2. Once this happens the function immediately makes a duplicate (or loads a 2nd swf) that goes directly below the first one, this time loaded onto level0 - depth 1.
My thinking behind this is that once you click on a button to load a new movie onto level0 - depth 2, and old version of that file is still sitting on level1 and therefore you won't see the flash of level0 behind it. But for some reason I don't think it is working.(if you click real fast you can see level0 flash behind the loaded movies)
Any help would be greatly appreciated. Thanks!
Sorry, I only attached the SWFs, I will have to send the FLAs in 2 seperate batches.
Here is file 2
Hi orangewhip,
I have downloaded your files and will give your problem
some thought then post back.
At a quick glance I still ask the question. Why not load
your content into empty Movie Clips or seperate Levels.
You said:
"I know I can load movies into higher levels but with the end user being able to continually select menu items I don't want the menu's being added on top of each other forever."
Forever .... does this mean that you have an "unlimited"
content that the user can load in ???
If you do have an unlimited amount of content, I can see why
you don't want to store the content.
However if your content is not unlimited....
I would consider that you load your content into empty
Movie clips or Levels. Once there it will not have to be
downloaded again.
For example lets say you have your content loaded into
the Movie Clip instances named (this has taken place when
the user has presses a button):
holder_1
holder_2
holder_3
You can then just switch between these Movie Clips (or Levels)
which contain your content with something like (really rough).
currentContent=0;
function switchContent(theRequestedContent){
//is the content the user wants to see different
//than what they are already viewing
if(currentContent!=theRequestedContent){
//make the requested content visible and enabled
this["holder_"+theRequestedContent]._visible=true;
//make the old content invisible and disabled
this["holder_"+currentContent]._visible=false;
currentContent=theRequestedContent;
}
}
This basicly uses a method similar to the Frame buffering
of realtime 3D graphics or originaly in hand drawn
cartoon animation. Your old content is not made invisible
until the new content has appeared so there is no background
flicker.
If you do have an unlimited amount of content then the same
method could be applied by using two Levels or Movie Clips,
your content is loaded into the inactive (_visibile=false;)
Level or Movie Clip. And you switch between these two Levels
or Movie Clips. In a way you are trying to do this with your
duplicated movie clip idea.
The above script would contain the ability to also check if
the content needs to be downloaded before it is displayed and
call the appropriate function. If the requested content does
need to be downloaded then the current content being viewed
does not change until the requested (new) content is loaded.
Give this some thought and post back ...
I will then spend sometime on your problem based on
you thoughts.
Milosav
Hmmm, yeah that is basically what I am looking for. The current page not to dissapear until the new page has been loaded (I want the pre-loader to show up on the current page tho)
There isn't an "infinite" amount of data to be loaded, but in order to show the preloader on top of the current page in my original concept...all newly loaded levels (or movieclips) had to be higher in depth than the current one, therefore making it so that all possible pages to be loaded would go on top of each other as long as the user continues to load pages.
How would you make that script you have there work with either 2 movieclips on seperate depths, or 2 seperate levels and have a user request a page, that pages preloader will show up on the current page until the new page is loaded, in which you will switch to the new page....all with no "flicker".
Like you said I have tried something similar to that with the dupicate movieclip...but am having a hard time fathoming why it isn't working, and your idea would???
Thanks for you help...this is GREATLY appreciated!
OK I have got a working sample now!!! The only thing is I guess I have to send the "depth" to the function for each button. I was hoping the function could automatically switch the depths around. I will think about this, but if you have any ideas that would be great!
Sorry, the reason why I would like it to take care of the depths itself is because I have a possible 30 movies that could be loaded in this way and I don't want to have 29 hidden and 1 visible. I would like there to be only 2 loaded at all times.
Hi Orangewhip,
I will put something basic together that I think will suit
your situation. I would be suprised if it was the perfect
answer to your problem first time around.
So if you think that it is headed in the right direction
I can then help you adapt it to you specific needs.
Expect something in a day or two ... I have relatives staying
and may not be able to do anything today.
But what you are looking for should not be a big problem.
Miloasv
Hi Orangewhip,
Here is a rough idea.
If you think it may be on the right track let
me know and I can clean it up .. and debug it.
It is a MainMovie on _level0 with three buttons
to load external .swf's.
A progress bar (Bar.swf) loaded into level6.
Content loaded onto Level4 and Level5.
Frame 1 of the loaded .swf's is blank with a
stop() action the content begins on Frame 2.Other
than button events there is no script in these
Movies. Each button event calls the function on
_level0 which does all the loading and level visibility
switching. The home button makes _level0 the currently
active content.
This script would need some more work but I quickly tested
it on the web and I am pretty sure that a robust version
could be put together and degugged in a few hours.
So have a look and let me know if this is heading towards
what you need.
You will not see the progress bar unless in a download environment.
And the external .swf file size was bulked up. But it is there and
based on my brief testing on the web it does work.
Milosav
Hi Orangewhip,
The "MainMovie" file in the zip I last posted is missing
a button event ... sorry ... here it is with all 3 buttons
working. Everything else is the same.
Milosav