Preload help
Hi there,
I will first admit that I use director mostly for moving
sprites and playing sounds, but when it comes to the script, I
suck. I am good at other types of scripting, and I have the general
idea of how to get the formula of a script to fuction, but I can
never get it going 100%. I am in desperate need of a preload
script, I know It's a hassle to see these n00b requests all the
time, but if someone could look at my script and tell me where I am
going wrong, it would be a big help. I only need this script to
work then I can apply it to all my work. Thanks in advance! :)
Movie has 1900 frames.
Here is my script, in frame 1:
on exitFrame
preLoad 0, 1900
if preLoad(0, 1900) = true then
go to "a"
end if
end
It accepts the script, but when it runs it comes back with:
Script Error: Function not defined
if preLoad(0, 1900) = true then
All i want to do is have this preload set up in frame 1, to
load the total frames, then advance to frame 2 (with the marker "a"
is) where a "play" button is on the stage.
Regards,
TMK.
Total-MK wrote:
> I just asumed this was the most lingo-basic way of
making a "loading"
> type preloader to load my full movie.
That isn't usually necessary as Director is usually good at
loading assets
as needed, and it isn't usually desirable to potentially fill
up the RAM on
the user's computer - indeed, unloading members when they're
finished with
can be very helpful.
If you're doing a Shockwave movie, google for "lingo
preloader". In
particular, the articles at lingoworkshop.com are useful.
Then in the google
results page click on "Groups" up near the top and have a
browser through
what's been written before in this ng.
HTH
Andrew
Similar Messages
-
can someone please help me out setting up my preloader... ive
got my main scene and scene 2 which is for my preloader... im just
looking to use one of the preloader components-- i dont want to
make one.... ive created a layer in scene 2 and placed the
preloader there---now how do i script it to go from scene 2 to my
movie...ive ooked at the tutorial's and it still confuses me...
again ive got scene 2 for my preloader and scene 1 which is my main
movie...
im looking to use not only a progress bar component... but
possibly a byte's loaded as well if that is possible...if that's to
much of an issue then ill just use the progress bar component..
ive got multiple progress bar components:
the byte's preloader set
a customizable load bar component
fr16 preload component
the flash ui components set
and the loader component from kirupa.com
im just looking to place the script...if you've got a sample
file please let me know; so, i can download and take it apart to
understand how it work's...
trey
if by chance you do a sample file-- either post it here or
email me @ [email protected]
thanks for your help...Thanks for the assistance. I managed to get it figured out.
Corrected the target paths (listed below):
stop();
_root.holder_mc.loadingBar._xscale = 1;
var loadingCall:Number = setInterval(preloadSite, 50);
function preloadSite():Void {
var siteLoaded:Number = _root.holder_mc.getBytesLoaded();
var siteTotal:Number = _root.holder_mc.getBytesTotal();
var percentage:Number = Math.round(siteLoaded/siteTotal*100);
_root.holder_mc.loadingBar._xscale = percentage;
_root.holder_mc.percentClip.percentDisplay.text = percentage
+ "%";
trace("Percentage is Working");
_root.holder_mc.percentClip._x =
_root.holder_mc.loadingBar._x + _root.holder_mc.loadingBar._width;
_root.holder_mc.bytesDisplay.text = "loaded " + siteLoaded +
" of " + siteTotal + " bytes";
trace("Site Loaded is Working");
if (siteLoaded >= siteTotal) {
clearInterval(loadingCall);
gotoAndStop(5);
Text field was visible, font just needed to be embedded. As a
note I placed a dynamic text box that spec'd _sans as the font with
the 'use device fonts' option picked. I had to respec a different
font and embed it into the swf.
Thanks again for the assistance! -
Can someone kindly show me/point me into the right direction on as to how to make a custom preloader. But the thing is i want it inside of a URL function.. Which is where im struggling. Can someone help? Many thanks.
I don't see anything in there that resembles an attempt to build a preloader and still cannot determine what you are referring to as a URL function. One thing I will suggest is that you break up your loader code a bit so that you assign the event listeners to it before you start loading as shown below. Cramming a series of operations into one line is not always the best way to go...
var urlReq:URLRequest = new URLRequest("https://api.twitter.com/1/statuses/user_timeline.json?screen_name=Scot tMitchell");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.load(urlReq);
If you look in the Flash help documentation in the URLLoader class section, at the very end of that section it shows a variety of events being coded, including the PROGRESS event that I added above. That may help you get a better start on what you want to do. -
hi all i have a burning question which i really need an answer to,
basically i have a preloader and i want it to load each section when called with this code:
callback function///////////////////////////////////////////////////////////////////////////////// ///////////
caps_mc.btn_continue_mc.addEventListener(MouseEvent.CLICK, nextpls);
function nextpls(e:MouseEvent):void {
MovieClip(parent.parent).nextSWF("startPage", parent);
the code above tells the preloader that it is finished with the startPage and in the preloader it should next load faq,
but i get an error saying that nextSWF is not a function when it clearly is,
is it even possible to use a preloader to load up swfs in this way??
preloader///////////////////////////////////////////////////////////////////////////////// //////////////////////
import flash.display.*;
import flash.events.*;
import flash.net.URLRequest;
var loadedSWF:Loader
var progressPercent:Number;
function startLoad(SWFName:String):void {
loadedSWF = new Loader();
loadedSWF.contentLoaderInfo.addEventListener(Event.COMPLETE, gameLoaded);
loadedSWF.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
loadedSWF.load(new URLRequest(SWFName+".swf"));
//track progress
function onProgressHandler(loadingProgress:ProgressEvent){
var percent:Number = loadingProgress.bytesLoaded/loadingProgress.bytesTotal;
progressPercent = Math.round((percent*100));
preload_mc.gotoAndStop(progressPercent);
preload_mc.myloadtext_txt.text=(progressPercent + " %")
preload_mc.myloadbar_mc.scaleX = percent;
preload_mc.mc_mask.height=(progressPercent * 3);
preload_mc.ofBytes_txt.text = loadingProgress.bytesLoaded + " bytes";
preload_mc.totalbytes_txt.text = loadingProgress.bytesTotal + " bytes";
function gameLoaded(e:Event):void{
removeChild(preload_mc);
this.addChild(loadedSWF);
loadedSWF.contentLoaderInfo.removeEventListener(Event.COMPLETE, gameLoaded);
loadedSWF.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler);
function nextSWF(whichSWFName, removeSWF){
this.removeChild(removeSWF.parent);
if(whichSWFName == "startPages"){
startLoad("faq");
startLoad("startPages");
here is the error
TypeError: Error #1006: nextSWF is not a function.
at startPages_fla::MainTimeline/nextpls()[startPages_fla.MainTimeline::frame1:7]
if anyone can help i would be most grateful, i am hoping to be able to have a re-useable preloader
thanks in advance
fonziohmm trace comes back will null
the way it goes is, i have a trial.swf
which is the preloader which loads start page in ok
on press of a button on start page i was hoping it would tell that preloader to go and relaunch but this time load ("faq"), i can use this code on a normal loader and everything will work fine the child is removed and another one loaded in, however the code itself needs to be in preloader form as the load takes a while to complete.
i do have some other code inside of the start page mc maybe this is affecting everything going correctly
its does this kind of check
stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.*;
import flash.display.*;
import flash.net.URLRequest;
var checks:Boolean = false;
// First claim and place all of the capabilities values into vars for easy code use below
warning_res_mc.visible = false;
version_check_mc.visible=false;
good_txt_mc.visible=false;
btn_flash_mc.visible=false;
btn_flash_mc.buttonMode=true;
btn_continue_mc.buttonMode=true;
var myrequest:URLRequest
btn_continue_mc.visible = false;
var version:String = Capabilities.version;
var language:String = Capabilities.language;
var os:String = Capabilities.os;
var screenDPI:Number = Capabilities.screenDPI;
var screenResolutionX:Number = Capabilities.screenResolutionX;
var screenResolutionY:Number = Capabilities.screenResolutionY;
// Then simply display in the dynamic text fields on stage
version_txt.text = "Flash Version: " + version;
language_txt.text = "Language: " + language;
os_txt.text = "Operating System: " + os;
screenDPI_txt.text = "Screen DPI: " + screenDPI;
screenResolution_txt.text = "Screen Resolution: " + screenResolutionX + " x " + screenResolutionY;
btn_flash_mc.addEventListener(MouseEvent.MOUSE_OVER, flashOver);
function flashOver(event:MouseEvent):void {
btn_flash_mc.play();
btn_flash_mc.addEventListener(MouseEvent.MOUSE_OUT, flashOut);
function flashOut(event:MouseEvent):void {
btn_flash_mc.gotoAndPlay(54);
btn_flash_mc.addEventListener(MouseEvent.CLICK, flashclick);
function flashclick(event:MouseEvent):void {
btn_flash_mc.gotoAndStop(1);
myrequest = new URLRequest("http://get.adobe.com/flashplayer/");
navigateToURL(myrequest);
btn_flash_mc.removeEventListener(MouseEvent.CLICK, flashclick);
var _fullInfo:String = Capabilities.version;
var _osSplitArr:Array = _fullInfo.split(' ');
var _versionSplitArr:Array = _osSplitArr[1].split(',');
/* declare the relevant infos */
var _osInfo:String = _osSplitArr[0];
var _versionInfo:Number = _versionSplitArr[0];
if (_versionInfo < 10){
version_check_mc.visible=true;
btn_flash_mc.visible=true;
btn_continue_mc.visible = false;
checks = true;
if (screenResolutionX > 800){
warning_res_mc.visible = true;
checks = true;
btn_continue_mc.visible = true;
if (checks != true){
good_txt_mc.visible = true;
btn_continue_mc.visible = true;
you see i am wanting to re-use the same preloader to load each swf as we go, although im not sure this is possible
thanks for your input
fonzio -
We created our portfolio in Flash
Flash Photo Portfolio
and now need a preloader. We were able to create one that waits
until the entire swf is loaded. We need a visual to indicate that
the movie is loading but don't want our viewers to have to wait for
the entire swf to load.
We don't want a dead black screen upon the calling of the
movie, but we don't want to wait for the entire movie to load
before the presentation begins. We have no problem creating the
graphics, it's the scripting help we need. Can anyone point us in a
direction? Thanks!
DickHere's the preloader I used, highly customizable:
http://www.programmingart.com/free/tutorials/flashloader/flashloader.html
Ryan
"Treece06" <[email protected]> wrote in
message
news:f5gi2t$dps$[email protected]..
> We created our portfolio in Flash
http://www.smolinskistudios.com
and now
> need
> a preloader. We were able to create one that waits until
the entire swf
> is
> loaded. We need a visual to indicate that the movie is
loading but don't
> want
> our viewers to have to wait for the entire swf to load.
>
> We don't want a dead black screen upon the calling of
the movie, but we
> don't
> want to wait for the entire movie to load before the
presentation begins.
> We
> have no problem creating the graphics, it's the
scripting help we need.
> Can
> anyone point us in a direction? Thanks!
>
> Dick
> -
I have a small SWF file (number countdown eg. 10,9,8,7.6....)
that I want use as a preloader for my main SWF file.
Can someone please point me to an actionscript template that
I can use to implement this.
Thanks kindly for any help.as2 or as3?
-
Undefined Error Preloader Help Needed
My AS 1.0 preloader code was set to work just fine using
Flash 6 in AS 1.0 and now I'm using the same code with a few slight
updates I've added for AS 2.0 in Flash 8 and still having problems
with an "undefined" error. I'm obviously missing something with
variables.., yes?
Thanks to anyone who can shed some light on this problem!Simon,
Thanks for your help, but it looks like my code is working
fine as I had it after some additional testing. Please note that
while I appreciated your intention to help... I need to warn others
that the link you've used in there has a sample display with
inappropriate material.
TO OTHERS: Please replace the following line: loadContent("
http://www.designbyclouds.com/pics/banksy_paris.jpg");
with your own link. -
Hi im having a litte trouble understanding the java preloader thing. im trying to get on an online chatroom from my 8100 i have already went to the broswer config and checked support javascript but when i sign on to go to my chatroom all that comes up is a white screen that says java preloader and it stays there forever. what am i doing wrong?? i just want to be able to chat. Thanks in advance!
Hi Nicole and welcome to the Blackberry Forum
Are you receiving any error number?
If I help you with any inquire, thank you for click kudos in my post.
If your issue has been solved, please mark the post was solved. -
So, I have my main swf requesting a load of the movie about_mov.fla, which just loads over the entire main movie site.
I have a preloader placed as well, but here is my code on the last frame of the main movie, to load the swf:
var imageLoader:Loader;
function loadImage(url:String):void {
preloader.visible = true;
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
loadImage("about_mov.swf");
function imageLoaded(e:Event):void {
preloader.visible = false;
imageLoadArea.addChild(imageLoader);
function imageLoading(e:ProgressEvent):void {
var loaded:Number = e.bytesLoaded / e.bytesTotal;
preloader.SetProgress(loaded);
I believe that it is working, however, there is a button in the loaded swf I am using to tell if it loaded or not, but i dont see it. How do I trace this event to check if it is actually working? As I suspect I am doing something wrong, since I never see that button coming.also, if i am loading in this swf, through the imageLoadArea I have placed on the stage, how would I navigate through the slides (it is a slideshow loading) with buttons placed on in the main movie file? because I can't refer to an instance name, would I refer to the .swf?
-
Flex soap client (interospection wizard) preloader help
hey guys, i have a small problem, im brand new to flex so i haveno idea what im doin... im using the flash builder (gumbo)
and basically what im doin is getting soap data from my server using the webservice interospection wizard.
what i cannot figure out is how to popup a loader bar, indefinite or definite dosent matter...
the current code i have is:
package modules.SiteEditor{
import mainScript.mainList;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import services.sites.*;
[Bindable] public class siteEditor{
// variables
public static var siteTitle:String;
public static var siteListData:Site;
public static var siteService:Sites = new Sites();
public static var isUpdated:Boolean = false;
public static function init():void{
siteService.addEventListener(ResultEvent.RESULT, resulting);
siteService.addEventListener(FaultEvent.FAULT, fault);
siteService.GetSite(mainScript.mainList.siteId);
//Alert.show("here");
public static function resulting(event:ResultEvent):void{
siteListData = event.result as Site;
siteTitle = siteListData.siteTitle;
isUpdated = false;
//Alert.show(siteListData.siteTitle);
//Alert.show("done");
public static function fault(event:FaultEvent):void{
Alert.show(event.fault.faultCode);
Alert.show(event.fault.faultString);
i have a vague idea about how to do this, but it dosent work...
what i tried to do is add another event listeler in the init function but i cannot see loadingEvent in the drop down list that pops up... if that makes any sence...
All i want to happen when the init function is called is a loader bar to popup.
thanks a lot in advanceanyone with any ideas???
-
Hi I have a pretty basic html website. with 10 or so pages,
each one has a large picture on it that takes a long time to load.
Is there a way so that when people first get to my site i
have a page that loads all these pictures then when done they click
to proceed to my site?
Many ThanksThere is no free lunch. A large image will load as if it were
a large
image.
> Is there a way so that when people first get to my site
i have a page that
> loads all these pictures then when done they click to
proceed to my site?
So - you want them to stare at a screen that says "loading,
please wait"
while all those images load? I'd just leave, and most other
people would
too.
Why are your images so large?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"brisboy" <[email protected]> wrote in
message
news:g52l35$cb3$[email protected]..
> Hi I have a pretty basic html website. with 10 or so
pages, each one has a
> large picture on it that takes a long time to load.
> Is there a way so that when people first get to my site
i have a page that
> loads all these pictures then when done they click to
proceed to my site?
>
> Many Thanks
>
> -
Please help me for the Preloader"Adobe Presenter"
Dear All
i followed the older discussions:http://forums.adobe.com/thread/240866?tstart=30
now in the Presenter 7 Settings (Theme Editor) that allows me to see the "adobe_presenter", i can even preview i did for the "adobe_presenter" in the theme editor.but when i publish it, it still keeps the same"adobe presenter" for the preloader.
help me please.Hi: You need this driver... http://h20566.www2.hp.com/hpsc/swd/public/detail?swItemId=ob_125640_1
-
Hi,
I have seen big improvement in Select + Update performance when I use Database.preload() + load all objects expliclty into memory by walking a cursor. I am not sure how much preload helps. Should I continue to call preload ?
With 5 Million users, the disk size of the JE db (shutdown) is around 30Gigs. Does it means it will require 30 Gigs to load everything into memory ?. Java 1.5 64 bit can accomodate 4G at the most, I will have serious issues, without preloading into memory, operations are slow. Can I just load keys - not the values would that help at all ? How can I save footprint and gain the speed ?
Thanks for any tips
VissuHi Charles and Mark,
Thank you for your comments. Here are the stats at the end of my test.
Currently my test does this (insert have been done before):
1. Database.preload(3Gigs)
2. Open a cursor and walk thru all records (takes really long time as you cited)
3. Create 5 threads that are ready to do selects on random keys
4. Create 5 threads that are ready to do updates
5. Start all 10 thraeds
6. Main thread waits on join of all 10 threads
7. Each thread when done posts the time it took and how many updates or selects it has done
8. Main thread wakes up when all are done, computes average and prints it, output is as follows:
Cumulative time for all updates = 820763 millisecs and # of updates = 1265633
Cumuluative time for all selects = 167253 millisecs and # of selects performed = 9525
9. Main thread prints JE stats, as below. I have only pasted non-zero values.
From the foll. stats, do you see any room for improvements ? Thanks a lot,
Vissu
processedBins=3
nEvictPasses=33410
nNodesSelected=3805500
nNodesScanned=38788430
nNodesExplicitlyEvicted=2101130
nBINsStripped=1704370
requiredEvictBytes=525320
nCheckpoints=7
lastCheckpointId=1766
nFullINFlush=6804
nFullBINFlush=5165
nDeltaINFlush=21762
lastCheckpointStart=0xf9d/0x97b2ab
lastCheckpointEnd=0xf9e/0x603498
nCleanerRuns=25
nCleanerDeletions=23
nINsObsolete=25975
nINsCleaned=1522
nINsDead=556
nINsMigrated=966
nLNsObsolete=1311240
nLNsCleaned=118475
nLNsDead=31387
nLNsMigrated=79164
nLNsMarked=98393
nLNQueueHits=91033
nMarkedLNsProcessed=88191
nToBeCleanedLNsProcessed=2278
nCleanerEntriesRead=1457242
nNotResident=143078946
nCacheMiss=143078901
nLogBuffers=3
bufferBytes=3145728
cacheDataBytes=3196616656
cacheTotalBytes=3199762384
nFSyncs=7
nFSyncRequests=7
nRepeatFaultReads=280102 -
The dreadful Scene Change and Preloader
I've put alot of blood, sweat, and tears into building this
site and the simple parts are causing the most trouble.
Scene changes work (used to), I found early on that if I
moved the longest scene to the end, it did not conflict with the
other menu buttons. It seems like at random, or when the movie is
slow to load, the buttons go to the wrong scene and start playing
at random frames and the buttons will not react.
Preloader works (on one scene), when i move the same eact
code to another scene and just change the instances and scene
information, I only get a blank screen when the movie is loading,
and then to top it off, it will redirect to another scene in an odd
frame. I have tried a number of diferent codes to make the
preloader work, all of the standard "stay on this frame until the
rest load and then play" codes.
I think these two problems are related and I was searching
for informaiton on ROOT and GLOBAL because I don't really
understand them. You can see some of my flash site at
www.danieljkessler.com I think the problem isn't the way I am
coding but something I am missing that is conflicting with scene
changes. Again, the navigation seems to work fine in the actual
movie file, but when its online or Previewed, it has these nasty
problems.
I am willing to pay a small fee to have them fixed or I will
fix them myself if someone can enlighten me as to what causes these
problems.i found out that you cant put a preloader on each scene, only
one time. So that was the problem. Took me a long time to figure
out the preloader script to only load partially, so I'll post that
here incase someone else has the same problems. Also, for that
person, you want to create multiple swf files and load them into
the file from the external location. That way you can have a
preloader for each scene. A note is to try to avoid scene changes
and work within one timeline, and also that scenes load top to
bottom unless you change the publishing setting, so if you are only
partially loading your movie and find some of the buttons to link
to the scene immediately, rearranging the scene download order by
dragging the scenes in the scene window in order can help to
correct this.
Second, the problems with the scene buttons not working when
the file was loading is because they are linking to scenes that
have not loaded yet. The preloader helps to fix this. Using the
frame name instead of hte scene and frame number usually works but
I think flash like consistency. If I use the same button in
difference instances, I had to use the same format for the
onRelease to work.
I have to say, flash is powerful but its also a huge pain in
the ***. Don't fool yourself, CS3 is not all mighty. I can't
emphasize enough how easy the hard things were to do and hard the
easy things were to do. Flash design is fun, but flash scripting is
real sorcery.
Thanks for all of your quick and helpful replies kglad,
especially during the holidays. My site can be viewed at
www.danieljkessler.com , I still have to do the chinese version,
but I plan using the same file and changing and redoing some of the
buttons with english. God help me. -
Hi,
I upload a website and I have problems with the preloader did it in AS3. It starts after two or three minutes. I have a MC with an animation of 100 frames and the dynamic text of the percent. The preloader is located in the 1 frame to the 10, I mean, first frame with the actions and the other three layers (text, MC and background) with a lenght of 10. The movie has 525 frames. Here is the code:
stop();
addEventListener(Event.ENTER_FRAME, lodeando);
function lodeando(event:Event):void
var bytesTotales = stage.loaderInfo.bytesTotal;
var bytesCargados = stage.loaderInfo.bytesLoaded;
var porcentaje = Math.round(bytesCargados * 100 / bytesTotales);
textoPorcentaje.text = porcentaje + "% Cargados";
cargaAnimada_mc.gotoAndStop(porcentaje);
if (bytesCargados == bytesTotales)
removeEventListener(Event.ENTER_FRAME, lodeando);
gotoAndPlay(2);
textoPorcentaje.text = "";
removeChild(textoPorcentaje);
removeChild(cargaAnimada_mc);
Please, Could you help me?.These screen captures show the library of the movie. As you can see I export the most of them. However I have doubts about if I must convert to symbol the graphics. I have the preloader in the "presentación" folder without any exportation.
Please, Could you correct the website?. Please, tell me an e-mail address and I send you the website via WeTransfer.
Maybe you are looking for
-
Error 130:11 in Adobe Acrobat X Pro
Whenever I try to open the application of Adobe Acrobat X Pro a window pops up with an error 130:11 message. It says to try to restart your computer and I have done that a plethora of times and it has not helped. What else can I do or what does this
-
Trap error in decleration block..?
in below code I know at line no 2 there is error of pricision length is too large. but i want to trap this error in exception or meant to say I want to display error message "number precision too large" while running this codelike other exception in
-
What generation is my iPad model mc 960 m/c?
Any ideas?
-
I'm trying to video conference with an aim user, however, the video feed from my aim buddy is full of pixels. I mean, it's so bad I can barely see make out my buddy. I know my buddy has a good web cam, so it's not that. Is there any setting that need
-
Link to page, not open new window
Hi there in Edge, how do I code to link to a page, without opening a new browser window (but also without using _self which caused problems by trying to open the link in the animation window). Thanks Simon