ActionScript 3.0 :: How To Pass XML From Preloader To Main SWF

Nov 22, 2009

I have been trying to figure out the following:
main.swf - contains my photo gallery application
preloader.swf - loads the main.swf file and on COMPLETE event displays it

At the moment the gallery list is in the XML file and the XML file is loaded from the main.swf file. However, as the XML file will grow, I want to preload the XML file along with main.swf file in the preloader.swf and then pass the XML data to the main.swf file so that main.swf file can use this XML data and can create the galleries from there. I am using AS3 Project in Flex Builder 3.

View 5 Replies


Similar Posts:


ActionScript 3.0 :: Pass Variables To An Inner Preloader?

Jan 9, 2011

I have a main preloader that loads Main.swf. Within Main.swf the user can open up other sub swfs, but they all need a preloader too. I have this all working for one sub swf, but I don't want to make 17 sub swf preloaders, and am wondering how I can - based on the button on stage pushed - pass along to the ONE sub preloader which sub swf to preload...

Is it possible to pass a variable between different swfs?Here's what I have now[code]...

View 7 Replies

ActionScript 2.0 :: Pass Variable To Main .swf?

Aug 23, 2007

Does anyone know how to pass a "page" variable thorugh link to a main .swf file (index.swf)?
The file would normally load "home.swf" into it if accessed by But I would like to able link to a different .swf determind by a varible like "page = contact.swf"

View 3 Replies

Flex :: Events - Pass Data From Preloader To App?

Jan 19, 2010

I would like to track the customer experience in downloading and initializing my flex app.

(a) Is there a way to pass data from preloader to the application? I would like to pass the time it takes to download and the time it takes to initialize.

(b)Alternatively: Is there an event at the application level that corresponds to the preloader events:

1. Download complete

2. Initialization complete (same as Application creationComplete)

View 1 Replies

ActionScript 3.0 :: Preloader To Pass Variable To Loaded Swf

Nov 21, 2008

I know this has been covered, I've read every post on this forum but I just can't make sense of it. I would like to pass a string variable from a preloader swf to the loaded one. My code's on the first frame on the timeline on both swfs and I'm not using classes. Here's my code for the preloader:

[Code]...

View 7 Replies

ActionScript 2.0 :: Pass Variable From Main Timeline To MC?

May 11, 2009

How do I pass a variable to be used for a dynamic text box inside a MC from the main timeline?

I am using AS2.0 in Flash CS3

View 2 Replies

ActionScript 3.0 :: Pass Main Class Instance?

Nov 27, 2009

I have a main swf that loads different swfs files, one of this swf files is the homepage with navigation items, how can I pass a reference to the loaded home.swf of the main.swf which contains the load methods?

I try creating a var in the home.swf class with the main.swf class type, but the home.swf give me errors that cant find other objects contains in the main.swf

View 6 Replies

ActionScript 3.0 :: Pass Variables From .as To Main Project

Nov 11, 2009

Im trying to pass a number to 1 function in my .as... In 1 part of my project i want to sent a number to .as function, and in another part i want to receive another value... like this.... The sintax is wrong, but i think i can made myself easier to understand...

[Code]...

View 0 Replies

ActionScript 3.0 :: Pass Variables From .as To Main Project?

Nov 11, 2009

Im trying to pass a number to 1 function in my .as...

In 1 part of my project i want to sent a number to .as function, and in another part i want to receive another value...

like this....

The sintax is wrong, but i think i can made myself easier to understand...

-----------------------------------------------------------------------
In this part i want to send a value to my .as function...
Ultimo(var int guardaultimo = 1);

[Code]....

View 8 Replies

ActionScript 3.0 :: Pass A Variable From Main Class To A MovieClip?

Dec 26, 2011

I have a document with main class.I also have some movieclips which have their own class and functions.I am trying to pass a variable from my main class to one of these MovieClips.I tried some stuff, nothing worked.

View 11 Replies

Pass Parameters To Flash Main (Document) Class?

May 2, 2010

In Flash CSn/AS3 you associate a Main class with a flash file which when loaded in the flash player "automatically creates an instance of the program's main class."I'd like to know how to pass arguments to the main class, since you don't write it yourself (you put its name in the Document textfield in the IDE).

View 1 Replies

Actionscript 3 :: Pass A Variable From The Main Fla To External As File?

Mar 7, 2012

I'm beginner in actionscript 3, and I'm trying to pass a variable from the main fla to external as file.

View 1 Replies

ActionScript 3.0 :: Pass FlashVar Values Through Preloader As Global Variables?

Jun 30, 2009

I have a program that uses a document class. The preloader.swf calls the main.swf. Problem is, the main swf uses FlashVars to set certain parameters. If I use preloader.swf to load the main.swf, FlashVars will no longer work.

So I need some way for preloader.swf to pass the FlashVars to the rest of the program.

View 0 Replies

ActionScript 3.0 :: Pass Parameters To A Function In Main Class From Loaded SWF?

Aug 15, 2011

I've got a main.as that loads SWF to the stage. the loaded SWF seppoused to pass a link to the main.as and trigger a javascript function to popUp that photo from that link.

I know there are two ways:
 
((root as MovieClip).parent.parent as Object).somefunction(parameters);
 
and to dispatch an event. inorder to pass parameters throug the event i need to extend it with another class.
 
isnt the (root as... )  more efficient if all i need is to pass a link?

View 7 Replies

ActionScript 3.0 :: Pass A Variable From A Main Movie To An Attached Movieclip?

Mar 28, 2012

I have a Flash Professionl AS3 project I am working on.

I have this in a main movie:
 
but1b.addEventListener(MouseEvent.CLICK, fbut1b, false, 0, true);
function fbut1b(e:MouseEvent):void{
var mc:documentwindow_mc=new documentwindow_mc();
mc.x=450;

[Code].....

The issue I have is I need to do this 40 times.
 
Is there a way for me to use the same documentwindow_mc movie clip and pass a variable to change the "documents/print2flashdocument1a.swf", part?
 
How could I do this from the fbut1b function?

View 3 Replies

Actionscript 3 :: Access The Main Class's Stage + Pass Functions As Arguments Like This?

Jan 22, 2011

There are two files in my actionscript project named "TestAPP", TestAPP.as and Draggable.as

TestAPP.as:
package {
import flash.display.Sprite;
import flash.display.Stage;[code].....

In "my actionscript theory", I'm supposed to see a circle that follows the mouse when I click it. (The draggable is not fully implemented) But the circle doesn't even budge .how to access the main class's stage property. I've googled for it, but still no progress.

View 4 Replies

ActionScript 2.0 :: Pass A Variable Defined On Main Stage To OnClipEvent Handler?

Jan 26, 2006

How can I pass a variable defined on the main stage to a onClipEvent handler?[code]

View 1 Replies

Link Preloader To Main Movie?

Nov 5, 2009

how to link the main movie to the preloader, so it counts the load and loads the main movie when it's done?

View 1 Replies

ActionScript 3.0 :: Display Preloader For Main?

Feb 17, 2010

I have just started to work in AS3 and stuck in a problem. I have created a fla document named main.fla I have defined the document class as Main which is attached. The problem is preloader shows only when the file is completely loaded. How can I appear the progress preloader for the main file.

View 4 Replies

ActionScript 3.0 :: Make Preloader In Main.fla File?

Feb 1, 2010

I have 2 files. I loaded img.swf to the main file and try to make preloader in main.fla file.
 
But after compile i get error: 1084: Syntax error: expecting identifier before modulus. 

Code:
var req:URLRequest=new URLRequest("img.swf");
var myLoader:Loader=new Loader  ;
function imgFileLoaded(event:Event):void {

[Code].....

View 7 Replies

Preloader Can Not Close After Main Site Has Loaded

Dec 11, 2010

I'm using the sample external preloader file supplied with CS5 as the basis for my customised pre-loader. It's working fine except that once the main site has loaded and is open, the preloader remains loaded in the background.[code]...

View 7 Replies

ActionScript 3.0 :: Sending Variable From Preloader To Main Swf?

Aug 13, 2009

I'm using a preloader SWF to load my content SWF and XML file, and when the COMPLETE event fires I'm using the following code to send my XML data to the content SWF -ActionScript Code:evt.target.content.sendXML(XMLData);I then have a sendXML function in the content SWF that picks up the data.This works - but I can't access XMLData right away (it's null if I trace it). But if I set up a timer with a tiny delay which then checks XMLData, the information is there.It seems to be a bit of a dumb way to do things. Has anoyone else got a better solution or a way that will allow access to the variable right away?

View 3 Replies

ActionScript 2.0 :: One Main Preloader For Multiple External SWF

May 2, 2005

I need to preload 2 external .swfs, one containing animation and one containing sound, and I need them to start playing at the same time. As of now I have a general preloader on the main timeline, but as you might expect, after the preloader finishes, there is a lag while the .swf's are being loaded. I thought everything was solved, until a friend of mine looked at it in dial-up, and the preloader just kept looping 10 times before the animation started, so now I'm starting over. Part of my complication I believe is that I'm using loadMovieNum into levels as opposed to loading the external .swf's in a separate container MC (that's what I've noticed most people recommend for this problem), but I tried doing that technique several times with no luck. Right now my main movie, index.fla, has a preloader MC in the first frame, with this AS attached to the clip:

Code:
onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
percent -= (percent-((loading/total)*100))*.25;
per = int(percent);
[Code] .....

The clip contains a loadbar, static text (which just says 'Loading'), dynamic text (which tells the percentage), and a 'stop' in the actions layer. In the actions layer within my main movie, there is a 'stop' on the first frame as well. On the second frame, there is this AS:
Code:
var audioOn = false;
loadMovieNum("musicfile.swf", 1);
loadMovieNum("1movie.swf", 2);
stop();

In order that the animation and music starts at the same time, within my animation .swf (1movie.swf), I have this AS on the first frame of the actions layer:
Code:
if (_level0.audioOn == true) {
gotoAndPlay(2);
}

Within my musicfile.swf, there is this AS on the second frame of the mp3:
Code:
_level0.audioOn = true;
My main objective is to be able to use my preloader to preload both of these .swf's concurrently in my main movie so that they may start at the same time.

View 1 Replies

ActionScript 2.0 :: Use The Main Preloader To Loads The External Swf's ?

Sep 20, 2003

I have a main swf loads a serveral swf's from the menu.how can i use the main preloader to loads the external swf's ?

View 4 Replies

ActionScript 2.0 :: External Preloader +swf Reloading Main Swf?

Apr 1, 2012

I have an External Swf with its own Preloader that is loaded into my Main swf,It works fine when i am testing it in Macromedia Flash 8 However when i upload all of it to my site and i click the button that loads the External swf in to my main swf it loads the hole main swf again and not the external swf. (NOTE i load the external swf into a MC ''myContainer2'' on the main swf) Here are my codes:

External Preloader
onClipEvent (enterFrame)
{
percent = Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100);
gotoAndPlay(percent);

[code]....

View 1 Replies

ActionScript 3.0 :: Call Function, Pass Value, Access Variable In Movieclip Class From Main Stage?

Nov 20, 2008

I have a movieClip named MC, and it's enabled with action script, with the class name MC_Rectangle and a Stage.I override the MC_Rectangle class file in a mc_rectangle.as external file.here is the code:

package{
import flash.display.*;
import flash.events.*;[ code].....

I have new a object in the main stage var

mc_rect:MC_Rectangle = new MC_Rectangle()

in main stage:

1. how can i access the variable "sequence" in "mc_rect"

2. how can i pass parametre from main stage to mc_rect via function setSequence(data:int)?

3. how can i call the function in addSequence() in mc_rect.

in asp.net, i usually use mc_rect.sequenct,mc_rect.setSequence(data), mc_rect.addSequence() to achieve my goals......btw, can function in mc_rect return out result to main stage?

View 1 Replies

ActionScript 2.0 :: [CS3] Preloader Doesn't Play Music In Main Swf?

Feb 8, 2009

this is how i attached the sound in the main swf, im using AS2

Code:
var x:Sound = new Sound();
x.attachSound("soundtracky");
x.stop();
x.start(0, 0);

I used the loader and the progress bar components.

The loader loads the main swf fine but the music doesnt play like this.

if I preview the main swf the music plays but with the loader it doesnt.

my first attempt worked with the preloader but by inserting the mp3 straight in the timeline.. I cant use it like this because I also need a mute button and I didnt find a solution.

View 1 Replies

ActionScript 2.0 :: Load External Swfs With Main Swf Preloader

Sep 3, 2009

My external swfs are taking 8-10 secs gap in loading inside main swf, that's why i want to load my external swfs with dynamic content at the same time when my main swf loads.

Code of preloader

Code on 1st frame:
onClipEvent (load) {
total = _root.getBytesTotal();
}

[Code].....

View 3 Replies

ActionScript 1/2 :: Preloading Main Site Swf And Intro Swf Within One Preloader?

Jun 26, 2009

I have a full flash website which is broken down into:
 
- Main movie which contains navigation and interface components

- Several content movies which are loaded into the main movie on demand

- An intro movie which is around 3MB in size; its a full CG movie.
 
At the moment the main movie preloads and then the intro movie preloads afterwards in a sequence; like so:
 
Main Movie > Intro Movie > Content Loads
 
There is a skip intro option which will skip the intro movie step and jump right to the content load once the main movie has loaded.
  
My client wants me to do something which is proving very difficult and I am starting to wonder if its even possible as searches on the net have given results which don't really work properly.
  
Here is what I need to do:
 
When the main movie is requested, its preloader appears which it has a load bar and a "skip intro" button. The difference being, this preloader will be loading the main movie AND the preloader; which the load bar representing both movies load progress.
 
To complicate matters, if the skip intro button is pressed, the preloader needs to drop the intro movie from the equation and just account for the main movie & thus skip the intro; straight to the content.
  
The way I have tried to do it is to have a preloader code in the intro which sends the total size and bytesloaded back to the main movie which deals with those values, adding it onto its own size. This is proving cumbersome and although appeared to be working, isn't working propery.

View 1 Replies

Flash :: Set Up A Preloader To Show The Load Progress Of The Main Swf

Nov 3, 2009

I'm trying to set up a preloader to show the load progress of the main swf, which has all of it's assets embedded. I found the factory class method as described on bit-101, but no load progress ever seems to show. The swf loads fine, but the bytesLoaded is always equal to bytesTotal and therefore the preloader is never called.

[Code]...

This correctly calls the Factory class first, and then instansiates Main and calls init(). But as I mentioned above the preloading is never shown as it seems to be loading everything straight away.Is this a problem with the way I'm embedding the images or because I'm testing locally?

View 3 Replies







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