ActionScript 3.0 :: Preloader Class In External .as File

Mar 27, 2010

I'm trying to wrap my head around AS3 and it isn't going well. I'm getting stuck on the most basic of problems it's making me pretty angry. I'm trying to do something as simple as reference the stage and I just can't figure it out; something that usually takes me seconds has eaten up 2 days of my time.

I have a Main.fla that outputs Main.swf; it contains no script, only library assets. I have a document class set up using Main.as, which itself has 1 trace and code to run the Preloader class, which is held in Preloader.as.

[Code]...

View 8 Replies


Similar Posts:


ActionScript 2.0 :: Including External Swf File With Preloader In Main Swf File

Apr 21, 2008

I'm creating a flash 3d website for a company. The idea is that there is one overall swf file - this holds the navigation and design. Once the user clicks on a button, it goes to frame 10, I have included the following script to load a swf file

loadMovie("deepbartesting.swf", maincontent);
this.onEnterFrame=function(){
if(movieClipName._currentframe==5){

[Code]....

the preloader works, but instead of going to frame 2 of that swf file, it goes to frame 2 of the overall swf that holds the navigation. Does anyone know how to get around this so that it goes to frame 2 in the same swf file as the preloader?

View 1 Replies

ActionScript 3.0 :: Preloader Breaks External Class?

Feb 18, 2009

I am having a problem with a scrollbar I created when I use an external preloader. The scrollbar is defined in an external class and works just fine when I compile that SWF and also when I view it. When I load the main SWF through the preloader, I lose any functionality on the scrollbar. Its like the preloader SWF strips the scrollbar class definition from the main SWF. Is this possible? Does anyone know what's going on here?

View 2 Replies

ActionScript 3.0 :: Preloader For External SWF Loaded Via Loader Class

Oct 15, 2010

I'm hoping to implement a preloader on a main.swf that measures the bytes etc loaded in an external.swf. My two concerns are that 1) this just isn't possible? 2) I can't have multiple preloaders on the main.swf, which I would if I used one for the external .swf. I intend to try and explain this in the best way I can what I have done so far, as I personally feel this is quite a complex task.

Here's the basics:
I have an external .swf file, being loaded, using the following Action Script (3), in what I shall call, main.swf:

//---loader---
var swfLoader:Loader = new Loader();
addChild(swfLoader);
var swfURL:URLRequest = new URLRequest("nameofswftobeloaded.swf");
swfLoader.load(swfURL);
function loadHandler (event:Event){
var thumbsPanel:MovieClip = event.target.content;
addChild(thumbsPanel);

This works fine. The Action Script I use after this simply allows me to control the external .swf from the main .swf so isn't necessary.. I finish the loader, with this:
"swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);"
So, this all works fine. However, as the external .swf contains images, it doesn't load instantly. I therefore need some kind of preloader to show how much of the external .swf is loaded. However, I tried placing this in the external .swf itself and it failed miserably - for some reason it basically didn't preload and the completed phase of the preloader just appeared.

View 1 Replies

Actionscript 3 :: Preloader For External Swf File?

May 13, 2011

Question! Whats the best way to have a preloader for loading an external swf file.I wrote this for the actual operation of the button

function btnClick(event:MouseEvent):void
{
removeChild(loader);[code]..........

View 1 Replies

ActionScript 3.0 :: Preloader Without External File?

Jun 13, 2011

I'm working on a project that requires a swf file to have a built in preloader. In the past, puting a preloader in caused problems, because the preloader, wouldn't load until about 90% of the swf had allready loaded. Is there a way to tell flash to load a particular frame first? Or perhaps stream itself?

View 3 Replies

ActionScript 3.0 :: Preloader That Loads An External .swf File?

Sep 3, 2010

I have a preloader that loads an external .swf file. Preloader works fine, technically the external .swf loads fine, but the external .swf is scaled up so you can only see about 2/3 of the screen. I made the stage for the preloader the same size as the stage for the external swf. I used the HTML for the swf that gets loaded, and just changed the file name to that of my loader.

View 4 Replies

ActionScript 3.0 :: Preloader For External File Template?

Sep 29, 2010

I used the CS5 Flash templates>sample files>preloader for external file, to create my preloader.The problem is that when the preloader is done and my SWF is loaded, my SWF has already started playing.It is an animation that builds for 200 frames then buttons appear.By the time the SWF appears it has already gotten to the button frame.Depending on connection speed I have caught the animation building.

Here is the preloader action:
var contentLoader:Loader; loadContent("stage002.swf");   function loadContent(url:String):void {   contentLoader = new Loader();  

[code].....

View 3 Replies

ActionScript 2.0 :: External File Preloader WITH Percentage

Nov 30, 2003

Basically, I adapted the design totally, but chose to display a percentage along with the animated "loading..." thing there.

One difference is that my buttons are located in the Transition movie clip and the loadText dynamic text field(where the percentage is displayed) is also in the Transition movie clip.

Here's the code I attached to Content movie clip:

onClipEvent (enterFrame) {
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());

[Code].....

If you visit [URL] you'll see the busted result.

For a deeper look the fla is downloadable at: [URL]

View 8 Replies

ActionScript 3.0 :: Preloader Which Loads An External File

Jul 14, 2009

I am building a peloader which loads an external file. Simulate donwload has never really worked for me, it just flashes and shows my loader at 100%. Does anyone have any tips to actually get this working?I have flash cs3, publishing to FP9 and using a simple LOAD_COMPLETE, onProgress function.

View 6 Replies

ActionScript 2.0 :: External File Preloader WITH Percentage?

Nov 30, 2003

Anybody finished Claudio's preloader tutorial?? Great tutorial... preloader works fine for me. However, I tried tweaking it a bit and cant get a part to work. Maybe someone can suggest a fix. I'm pretty sure its a simple thing I'm not seeing. Basically, I adapted the design totally, but chose to display a percentage along with the animated "loading..." thing there. One difference is that my buttons are located in the Transition movie clip and the loadText dynamic text field(where the percentage is displayed) is also in the Transition movie clip.

[code]...

[url]

View 11 Replies

ActionScript 3.0 :: Creating A New Instance Fails When Base Class Is Assigned To An External Class File?

Jul 22, 2009

I'm trying to create a new instance of a MovieClip when the original one has been used. Would sound easy enough. Just use: var

instanceName:ClassName = new ClassName();

the class name/mc in the library im trying to duplicate is MCg1 so

var instanceName:MCg1 = new MCg1(); right?

However, the particular object in the library i'm trying to duplicate has a base class that is an external class file (just to control it's drag drop functionality)... i.e baseclass is not set to the standard flash.display.MovieClip, or whatever the case maybe. So i end out with a: TypeError: Error #1009: Cannot access a property or method of a null object reference.

View 6 Replies

ActionScript 2.0 :: Show Preloader Before External Swf File Is Loaded?

Apr 21, 2011

I have been looking for a way to show a preloader before the external SWF file loaded but unfortunately I had no luck as of yet!!I have a button that loads a few external files in some empty MCs. I just want to show a small preloader before the external SWF files loaded?

View 1 Replies

Flex :: Make A Preloader With Load External File?

May 5, 2011

I am currently working with Flex 4. I successfully use custom preloader by s:application ... preloader="path"..., but i want the preloader to load external file as well, can it do that? How can i call the variables in the preloader?

View 1 Replies

Flex :: Preloader Has To Be Visible Until Other External File Loaded

Jun 13, 2011

I have a Flex application that loads some data from the database. During this I want my custom preloader stay visible. When I postpone the dispatchEvent( new Event(Event.COMPLETE)) in the FlexEvent.INIT_COMPLETE handler, the loading will never happen because the next frame is not entered. How can I keep the loader running until all the data is fully loaded?

View 1 Replies

Actionscript 3 :: Flash External Preloader To Load A Swf Thats Loading Another File?

Jun 10, 2010

I have my preloader loading my main swf where I'm loading another swf that contains a background.

When my preloader is done it shows my main swf but it takes a while after that for the background to load.

Whats the easiest way to get my preloader to wait until the background swf is done loading?

View 1 Replies

ActionScript 3.0 :: External Swf File Loaded By Preloader: Place And Size?

Feb 22, 2011

i try to implement a preloader for my site but i have the following problems:once the preloader is finished it opens my external swf but this one appears below the preloader and very little in the window (almost smaller than my preloader size)

package classes
{
import flash.display.MovieClip;

[code].....

View 0 Replies

ActionScript 3.0 :: Flash Preloader Pause After External File Loaded?

Aug 24, 2010

I have a preloader.swf that loads another swf (main.swf). It all works fine, however I would like the loading bar to stay on 100 (once it gets there) for 2-3 seconds before the main.swf opens, currently as expected from the code below, as soon as it gets to 100% it flicks straight over to the main.swf.

I am using tweener, and I could achieve this easily using the onComplete code to call this.addChild(loader);, however, the problem is, both my preloader and my main swf are liquid layouts, and if I were to call the this.addChild(loader); at the end in its own function, then it throws a

TypeError: Error #1009: Cannot access a property or method of a null object reference.

. The only way to get around this error is to put the this.addChild(loader); so that it loads upfront. After a bit of google research, i found this error occurs due to the stage properties already been set in the preloader.swf (from liquid layout)then once the main.swf loads it tries to set them again...So is there another way i can cause a delay for 2-3 seconds once my preloader hits 100?

Below is my preloader code with liquid layout settings

Code:
//LIQUID LAYOUT
stage.align=StageAlign.TOP_LEFT;
stage.scaleMode=StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandlerLoading);

[Code]....

1. using my tweener onComplete method and fixing the error caused by preexisting stage properties

2. Thinking of an alternate way to delay the main.swf from opening straight away (keeping in mind that this.addChild(loader); would need to stay where it is...

PS - here is a link to a person who was getting the #1009 error with preloader and liquid layout, their solution works, but won't allow me to use a tweener delay...[URL]

View 2 Replies

ActionScript 2.0 :: Adding Preloader Into External Swf File For Transition Loading Question?

Apr 18, 2007

[URL] The website button function and External swf transition scripting is base on that tutorial. it would be great if i could let peoples to see the preloading process while my web loading the external swf file.. can any one here tell me how to add a preloader to show loading progress every time the external swf files loading?

View 2 Replies

ActionScript 3.0 :: Flash Preloader That's Aware Of Multiple External File Sizes?

Aug 14, 2010

I have an AS3 .fla that loads an external XML file of image names, and then iteratively loads the images into the .fla. All this works great. What I want is to create a preloader that is aware of the size of all these external images. As far as I can tell there's no way to do this, but I'm hoping someone here is smarter than I am.

I tried Lee Brimelow's method of having a separate SWF whose only job is to load another SWF in its place. This doesn't work because the preloader's call to .bytesTotal only reads the bytes of the main SWF, not of the external XML or JPGs that are dynamically loaded into it. So the result is the preloader reaches 100% when the main SWF is loaded, but that happens really quickly and the bulk of the load time comes after the 100% mark, when the main SWF starts loading in images.

The more I think about this, the more it seems that you can never access the .bytesTotal property until you've already instantiated the loader and called the .load() method. Am I wrong? Is there a way to fetch just the SIZE of an external file without actually initiating the act of loading the file into memory?

View 4 Replies

Professional :: Load Preloader From External File Or Place It Directly Into Existing Movie?

Sep 13, 2010

Is it best to load the preloader from external file or place it directly into an already existing movie?

View 3 Replies

Professional :: Merge External Preloader With An Preloader From Oxylusflash

Dec 18, 2011

I've got an external preloader from this tutorial [URL] and i would like to merge it with an preloader from oxylusflash (its a premium preloader)

[Code]...

View 2 Replies

ActionScript 3.0 :: Loading Class From An External .swf File?

Dec 11, 2009

My flash application has lots of resources which will change all the time. In order to keep the the user from having to download my main .swf file over and over again, and in order to keep the main file's size low, I would like to put the resources into separate .swf files and load them dynamically from a url using a Loader.
 
Once downloaded I would like to extract the classes that are in the resource swf and use them in the main swf. Can anyone share some code for doing this? Note that I am not just interested in using a symbol from the resource swf. I would like to use a class, with all of its methods and everything, and my main swf does not contain the class definition. Only the resource swf does.

View 3 Replies

ActionScript 3.0 :: Turn An External MP3 File Into A Class?

Aug 17, 2011

Is it possible to load an mp3 file and then turn it into a class?[code]...

View 9 Replies

ActionScript 3.0 :: Loading External XML File From FLA To Class?

Jan 14, 2009

I have been searching for information regarding the use of loading an external xml file from a variable (string) that contains the location of the item and passes it to the document class.

I receive the following error:
Error: Error #2136: The SWF file file:///C|/Documents%20and%20Settings/xmikxm0/My%20Documents/workingDocuments/freelance/brightStar/webSiteStructure/core.swf contains invalid data. at BuildSiteElements/::frame1()[BuildSiteElements::frame1:2]

FLA code:

ActionScript Code:
/* variables to load XML */
var BuildItems_obj:BuildSiteElements = new BuildSiteElements();
BuildItems_obj.loadSiteXML("templateBuild.xml");

[Code]....

fla is in same folder as class and the fla compiles the swf in another location (outside the folder and pulls xml from the xml folder).

View 3 Replies

ActionScript 3.0 :: Access MovieClip From External Class File?

Jan 19, 2009

I am currently using an external Class file for an instance in my .fla project. It creates an instance of that specific class and has it carry out some functions.I want to access a MovieClip on the stage in the .fla file in the external Class file. How can I do this?For example, the Class file creates an instance of that class, and I want the x and y coordinates of that instance to be equal to that of let's say circle_mc. Now circle_mc is on the stage of the .fla file, and therefore cannot be accessed. How can I get around this?

View 5 Replies

ActionScript 3.0 :: Flex Accessing External Class File

Jan 25, 2010

I have downloaded an AS 3 class file, designed to create an MD5 hash from a string. I have put the class file in my /components directory (with / being the root of my Flex project source).[code]...

View 2 Replies

ActionScript 3.0 :: Access An External Class In An Existing Fla File?

Dec 20, 2010

I have an Existing FLA file (It is my Project file) and I have downloaded one good example Class file with Fla. But there is no code at all on the stage just it is retrieving instructions from the Class. How can I use this class file in my existing fla file.

View 3 Replies

ActionScript 2.0 :: Create A Preloader (in Flash With The "percent-loaded"-thingie) For An External .html File

Aug 4, 2004

I want to create a preloader (in flash)(with the "percent-loaded"-thingie) for an external .html file that I want to load. Here's my code:

[Code].....

On the "main" frame" I've put a getURL action on a movieclip. Can this work.???? I'm still new at this and a bit confused?

View 6 Replies

ActionScript 2.0 :: Making Preloader Into A External Preloader?

Jan 15, 2004

changing a preloader I have into a preloader that can be used for loading external swf.Now the code for the preloader is

loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);

[code]....

Ie the preloader and steps through a preloader animation filling the logo (ie loader)Now I have tried changing a few things but having problems tried loading into a container and a level

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved