Flash :: Passing LoaderInfo To "Main" Class From Preloader?

Nov 13, 2009

I initially wrote my Main class to read from LoaderInfo to parse some parameters, but then I recently added a Preloader, with that being the "main class". Is there a clean way to move things over, or to retrieve LoaderInfo?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: LoaderInfo - Importing A "FlashVarsParam.as" Class File In Main Class

Sep 12, 2009

I am facing a technical proble when I am importing a "FlashVarsParam.as" class file in my main class " VideoPlayer.as" and when I am using "FlashVarsParam.as" in my FLA doucument class "VideoPlayer.fla" then it is workining fine. "FlashVarsParam.as" file given below so I am accessing in my main class and then it gives me error

[Code]...

View 1 Replies

Actionscript 3 :: Flash - LoaderInfo From A Class

Dec 4, 2011

I am using flashvars to get some info. When im using LoaderInfo(this.root.loaderInfo).parameters from the main fla frame it works fine but how can I use it from withing a class? Something like this -

[Code]...

I'm getting this error message: Access of possibly undefined property root through a reference with static type. Hope someone could guide me how to overcome this.

View 1 Replies

Flex :: Passing Data From Custom Class To Main Application?

Aug 4, 2011

Im a complete beginner in Flex programming. I have an application with a main .mxml file, and a certain class Foo that I call from the .mxml. In Foo, I make a URLRequest and listen for the Complete event. Then I found myself with the returned data in a Foo function, but I have no idea how to communicate it to the .mxml part of the application ! I looked into ArrayCollections but I can't seem to understand how they work. Isn't there a way to modify, from inside the class, a variable with a global scope ?

View 5 Replies

ActionScript 3.0 :: LoaderInfo Not Working Properly In Class?

Jan 7, 2011

The class that I am struggling with is not the Document Class. I've had great success grabbing variables using LoaderInfo there when building the page from the start. LoaderInfo works great there, I think I am struggling to understand how to use it with the nested classes.This class, SetBookMark.as, is imported into another class that controls button methods. When the user clicks the exit button, its supposed to set the cookies and close the browser window. I've done a lot of error checking and JavaScript alerts to ensure everything is functioning properly and my classes are pulled in correctly. The code I posted below from the navigation class I have built is just the important part showing that I have called the class, added it to the DisplayList. Everything works great other than where it fails to grab the closeTheWindow variable and what its set to.This is the variable in JavaScript that I am trying to grab using FlashVars and LoaderInfo.

Code:
document.movie.FlashVars = "closeTheWindow=true";
Snippet from navigation class that I pulled together

[code]....

View 2 Replies

ActionScript 3.0 :: Access LoaderInfo And Call Functions In Class

Nov 30, 2010

how to access loaderInfo and also call functions immediately in a class.My game is 99% there, but for this problem, whenever I run the code in the order below, I get:Error #1120: Access of undefined property root.Error #1009: Cannot access a property or method of a null object reference showMessage();[code]Is there a way I can get the loaderInfo parameters immediately, and call showMessage() if previewcard is true?

View 5 Replies

ActionScript 3.0 :: Flash Image Won't Load From Class Referenced By The Main Class

Jul 25, 2011

why my image won't load when I have it's class referenced from the document class rather that being in the document class?

This produces no errors and the second class traces the note, but it doesn't load the image.

// ----- Main Class
package {
import flash.display.Sprite;

[Code]....

View 2 Replies

Actionscript 3 :: Flash Failing With A RSL Library, When Main Class Extends A Class And Implements An Interface?

Mar 13, 2011

I'm trying to load a RSL library into a flash animation developed with Flash CS5 IDE, that extends a custom class and implements an interface. I have reduced the problem to the simplest setup and find that I can have my main class extend another class or implement an interface, but not do both at the same time if I want to load an RSL.I have a very simple class to extend:

import flash.display.Sprite;
public class MySprite extends Sprite
{[ code]...........

but if I want both I get the VerifyError: Error #1014 with MySprite not found and ReferenceError: Error #1065.

View 2 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

ActionScript 2.0 :: How To Add Preloader For Main Timeline On Flash Site

Feb 14, 2007

So I make my site in flash, forget to add a preloader for the main timeline. I go back and add the extra frames to allow this but as soon as I add even just one more frame it make all my graphics go jaggy edged!?! See diagram below.

View 6 Replies

Flash - Listener In Main Document Class For Custom Dispatch Event From Another Class Does Not Respond Or Call Function?

Apr 1, 2011

I have a document class called Main.as In the class constructor I have the following listener:

enter code here
var listeningFORModeChangeToStudent:Sprite = new Sprite;
listeningFORModeChangeToStudent.addEventListener(TellAllModeChangeToStudent.STUDENT,exp);
addChild(listeningFORModeChangeToStudent);

[code]....

In a third class I make a call to the despatcher in the previous class:

enter code here
var ThisTellAllModeChangeToStudent:TellAllModeChangeToStudent = new TellAllModeChangeToStudent;
ThisTellAllModeChangeToStudent.tellAllModeChangeToStudent();

I have trace statements in eveything and from this I know the despatcher in TellAllModeChangeToStudent is being called.The problem is that the listener in the main.as is not calling the function exp.I cant see why and I dont know how to check if the listener is actually seeing the dispatch event?

View 1 Replies

Flash :: Create A Separate Class Then Create An Object Of That Class Within The Main Class?

May 17, 2011

I'm new to Flash AS3. I started making a game and I am a bit confused. Let's assume that I want to create a game that has multiple levels/modes, how can I do this in an object orientated way?

When i create games in other languages e.g. XNA C#, i create a separate class then create an object of that class within the main class and run the game based on a simple statement.

[Code]...

View 2 Replies

ActionScript 3.0 :: Flash Passing Var To The Other Class?

Apr 3, 2011

how to pass the value of a variable in class1 to class2?

View 1 Replies

ActionScript 3.0 :: Import Other Classes Into Main Class Or Extend Other Classes To Main Class?

Aug 1, 2011

how to get a Class file up and going in Flash and that works fine but say I want to import other classes. I try "import testCass" above in my import statements section of my as file and that doesn't work. What do I have to do to get that to work?

View 6 Replies

ActionScript 3.0 :: Execute Functions In Main Document Class When Main Timeline Reaches Frame X

Oct 16, 2009

I have 3 functions in my main document class that I want to execute when the main timeline reaches a particular frame number. how do I do that?

see the code and comments

public function mainClass()
{
//stage declaraction
stage.align = StageAlign.TOP_LEFT;

[Code]....

View 5 Replies

ActionScript 3.0 :: Passing URLs For Class As Parameter In Flash

Aug 19, 2009

I am calling java servlets from flash using the following code [below is a sample Flash code for calling a java servlet in Flash which I am using]:
String url_String="[URL]"; var req:URLRequest = new URLRequest(url_String);

In this case, the servlet is called/working fine only in my system where the flash application is deployed & not working when I execute the application in different system using the "IPAddress" of my system. So, What changes I need to make in above Flash code in order to call the same servlet successfully from my system and as well as from other systems? (OR)

Is there any need to pass the servlet-url's relative instead of absolute? If so, How can we pass relative-path of url's in Flash? && Can anyone explain me with an example? How to change my above code to pass the url 'relative' rather than 'absolute'? If I pass the url relatively, does my issue gets resolved?

View 8 Replies

Flash :: Why LoaderInfo.bytesTotal Is Zero

Nov 22, 2011

I'm developing a flash file that that will be uploaded to dozens of websites which I have no control over. I found out that one of them seems to be gzipping the swf, which is causing loaderInfo.bytesTotal to be zero. This screws up the loading animation. I tried a workaround of just testing if bytesTotal is zero, if so simply proceed. That doesn't work because, as expected, not all the necessary data has loaded yet. Alternatively I can put a timed delay of whatever the expected load time is, and hope that it covers all the bases.

Does anyone have any other suggestions? Ideally there's an alternative way to define bytesTotal, but I haven't found one. FYI this is somewhat related to this question: Why loaderInfo.bytesTotal is Zero But I can't do the htaccess suggestion because I don't have control over the other websites, some of which may be on windows servers anyway.

View 2 Replies

Professional :: Preloader Not Passing Over NextFrame()?

May 5, 2010

The preloader I created doesn't transistion to the next frame, it just hangs on the preloader frame at 0%.

stop();
loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader);
function updatePreloader (evtObj:ProgressEvent):void{ var percent:Number =

[code].......

View 5 Replies

ActionScript 3.0 :: Passing Variable From Document Class To Movie Clip Class?

Oct 12, 2010

i have a movie clip which is exported for ActionScript , i want to get a variable from the document class into the movie clip class i tried this but there was an error !!

ActionScript Code:
var main:Main=new Main();
main.txtScore.text="hello";

View 1 Replies

ActionScript 3.0 :: Set LoaderInfo Params From Flash

Oct 7, 2010

This is my case

1: I have two swf : a.swf n b.swf

2: I can't do any coding on a.swf but I can code on b.swf

3: b.swf loads a.swf

4: a.swf takes some params from html

5: Since b.swf now loads a.swf,how can I set loaderinfo params of a.swf from b.swf?

So is there any way I can set loaderinfo params from loading swf to the loaded swf.

View 3 Replies

ActionScript 3.0 :: Set LoaderInfo Params From Flash?

Oct 7, 2010

This is my case1: I have two swf : a.swf n b.swf2: I can't do any coding on a.swf but I can code on b.swf3: b.swf loads a.swf4: a.swf takes some params from html 5: Since b.swf now loads a.swf,how can I set loaderinfo params of a.swf from b.swf?So is there any way I can set loaderinfo params from loading swf to the loaded swf.

View 6 Replies

ActionScript 3.0 :: Passing Data From Document Class To Base Class?

Mar 1, 2011

I created a movieclip with a star. Then, I creates a document class and I named it as Main.as.

In that document class I wrote:
package
{
import flash.display.*;
public class Main extends MovieClip

[Code]....

I´m not posting here all the code, but you can easily see that I´m using x_origin and y_origin variables to keep the original position of the movie clip. I will use them to move the star back to the original position.
 
The problem is that instead of being 20 and 30 respectively, tracing them I see that they are both ZERO. So when I drop the star, instead of going to x=20,y=30 it moves back to x=0 and y=0. I´ve to get the star position relative to stage, but I can´t find anyway!

View 4 Replies

ActionScript 3.0 :: Passing A Variable From The Document Class Into A Custom Class?

Dec 28, 2009

I'm trying to create a class which will create a tween for several different instances of an object. I am creating the instances in the Document Class. The trick is, I would like to specify how long each tween will take.

Here's what I have so far:

DOCUMENT CLASS

ActionScript Code:
package {
import flash.display.MovieClip;
import mcCloud;

[Code].....

As you can see, I have a variable "myTime" which syncs the timer and the tween. This causes to tween to repeat and the clouds to continually scroll across the stage. How can I determine the var myTime at the time I create each instance of the Movie Clip mcCloud?

View 6 Replies

ActionScript 2.0 :: Passing A Var From LoadMovie To Main?

May 25, 2010

So I got a plethora of games (group project), and we found the easiest way of putting them together is by loading each .swf of those games into a main .fla that will load each and will act as a menu between them. I need to know how a movie loaded to the root timeline can communicate with the main root.

I'm using _root.loadMovie("swf.swf"); to load the movies (one frame per swf). I tried containers with _root.container.loadMovie("swf.swf"); (empty MC on the stage with container instance name) but it ended up just looping the first frame of the loaded swf and not working like it should.

I tried using _global, that didn't work. I'm not sure what else to try, or what would work.

View 7 Replies

ActionScript 3.0 :: Passing Xml Data To Main.flv?

Aug 5, 2010

So I'm trying to make a project with multiple rss feeds on one page. All the rss feeds are in one xml file. this works fine but now I need to retrieve rssdata from each rsslink.

To do that I want a variable to be filled up with the rssData that I retrieve via an external actionscript file.

So in my main actionscript I would have something like this:

ActionScript Code:
var rssLoader:RssLoader = new RssLoader;
var rssData = /* THIS IS WHERE I WANT MY RSS DATA TO COME */

[Code].....

View 9 Replies

Actionscript 3.0 :: Passing Var From Loader Swf To Main Swf

Mar 24, 2009

I´ve searched this all over the net but no success. I have a .swf loader were you can choose a language and then load the main swf. What I´m trying to do is to pass an variable from this loader.swf to the main.swf.

View 2 Replies

ActionScript 3.0 :: Passing Var From Loader Swf To Main Swf?

Mar 24, 2009

I have a .swf loader were you can choose a language and then load the main swf. What I�m trying to do is to pass an variable from this loader.swf to the main.swf.

View 10 Replies

ActionScript 3.0 :: Passing A Variable To A Loader From The Preloader Swf

Feb 9, 2009

I have a preloader.swf which loads in media_player.swf which is fine. thats all working I also have the preloader loading in a variable from the webpage using flashvars and thats also fine i have that outputting onto a text box so i can see it but what im trying to do is set the source of a uiloader inside the media_player.swf to the variable that im loading into the preloader.swf.

View 1 Replies

Passing Name Of Video To Be Loaded From Document Class To Another Class?

Aug 6, 2009

I've got a document class (EgoGame.as) and another class (Ball.as) which has been duplicated to deal with several different video pieces. Inside the document class is a list of 'if' statements which decide which video should be played. At the moment I'm doing it the old fashioned way whereby if the condition is true....it tells the relevant Ball class to gotoAndPlay a certain frame within the linked movieclip...

[Code]...

View 1 Replies

Flex - Error #1088 On Passing A Class As A Parameter For Web Service In Flash Builder

Feb 8, 2011

I need to pass a struct and a string in a web service. I am using a WebService components to do so.upon my search, there is no struct type in actionscript and so I used a class for that one.

public class UserInfo{
public var name:String;
public var dateAdded:Date;
}

and I'm filling it up so that I can pass it on the web service like this:

var newUser:UserInfo = new UserInfo();
newUser.name = "myName";
newUser.birthdate = new Date();
webServComponentId.operationToCall(newUser, "password");

Upon sending this request, it prompts me an error of Error #1088.

the component that is being called by webServComponentId.operationToCall(newUser, "password"); is this:

<s:WebService id="webServComponent" wsdl="[PATH OF WSDL HERE]" >
<s:operation name="operationToCall" result="functionToCallWhenResult(event);" fault="Alert.show(event.fault.faultString)" />
</s:WebService>

Basically it is a web service via MXML. So when I call the operation, it always go to fault part and shows Error #1088

View 1 Replies







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