Actionscript 3.0 :: Sending URL From Fla To Class Receive ArgumentError

Jul 20, 2009

I have two files, one is Slideshow.as which loads the XML which justs traces out the content. However when I try and load this class from an .fla file I received the following error:

ArgumentError: Error #1063: Argument count mismatch on Slideshow(). Expected 1, got 0.

In my FLA the document class is set to Slideshow with Slideshow("slideshow.xml"); on the first frame.

Here is my Slideshow.as file:

Code: Select allpackage
{
import flash.display.MovieClip;
import flash.events.Event;

[Code]....

I don't quite understand why I am receiving the error. I'm used to writing AS straight into a frame of an FLA however I decided to attempt to write a class file.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Eating A Global Listener On The Class And Receive Dispatched Event For Any Instance Of The Class?

May 11, 2006

I've done a class to be able to listen to the event for a CLASS not on an instance.

Code:
class net.webbymx.events.XClassEventListener {[code]....

why did I do this.It cames with my rugby game.I have player in two teams. When a player throw the ball I want the other teammate to act like "wait for ball" and the opponent like "seek for ball". Plus I'm lazy (and I don't want to register the listener for each instance of the player I'm creating). So this class is made to be able to handle as many instance of a class I want without adding a listener on each of them. I'm just creating a global listener on the class and then I will be able to receive dispatched event for any instance of this class .so in my team I can do

Code:
XClassListener.initialize(this);
this.addEventListener("throw", "net.webbymx.game.Player", "wait");

and in my opponent team I can do

Code:
XClassListener.initialize(this);
this.addEventListener("throw", "net.webbymx.game.Player", "seek");

View 4 Replies

ActionScript 3.0 :: Sending Class Name To Another Class?

Sep 2, 2009

I have a movieclip in a library with a class name: menuItemMC

now I want to send this to another class:

var myClass:CustomClass = new CustomClass(menuItemMC);

and then in that class I need to use this like:

//contructor
public function CustomClass (menuItem:* );
var customID:menuItem;
customID = new menuItem();

I tried something like this, but its not working...how do I receive this and use it from there?

View 5 Replies

ActionScript 3.0 :: Sending XML Data From 1 Class To Another?

Jan 8, 2010

I am building an APP and have a movieclip(loginScreen_mc) on stage which has a linked class. This class (login class) recieves some xml data and then tells the parent swf (parent.loginScreen_mc) to goto next frame which has a movieClip on it and yes this movieclip has a linked class (case class).

how do i send the xml data recieved in the login class to the case class. I tried to send it to the case class's constructor fn but it doesnt like that.

View 5 Replies

ActionScript 3.0 :: OOP Sending Info From One Class To Another?

Sep 10, 2010

i have backdoor ways of getting info from other classes, but they seem to be far too long. So I am trying to do something different.. Imagine two entirely separate classes. The classes only extend MovieClip, and don't know about one another. What is the best way for them to know of eachother, without extending one another.

I thought it was interfaces, so I made an interface, and tried to send information from classA to classB within the interface. So, I had classA set the implemented interface variable to "21" and was trying to get that information on from classB, by implementing the same interface, and rather than setting, classB is getting. It didn't work. Where am I going wrong? Do I not need to use an interface?

View 3 Replies

ActionScript 3.0 :: Sending A Variable To A Function In Another Class?

Oct 11, 2009

I have two classes one called 'LoaderSwf.as' which is used to talk to all the other classes im using. I also have a 'GeneralTimer.as' which works fine from a stand alone 'GeneralTimer.swf' file. What I am trying to do is send a value of 10ms to the 'GeneralTimer.as' which will then run the timer and when complete send a value back. But for simplicity im trying to send a 10 ms value to trace("tick") and trace("tock").

I keep getting error "TypeError: Error #1034: Type Coercion failed: Cannot convert 10 to GeneralTimer." this is according to Adobe "1034 Variables cannot be native." What does that mean for starters?

Here's my code:

in LoaderSwf.as

Code:
var w:Number = 10;
GeneralTimer(w);
in GeneralTimer.as

[Code].....

so as you can see I want to send the number 10 to be used in the GeneralTimer. I am sure I have used this before (in CS3) and its worked but am now using CS4

View 4 Replies

ActionScript 3.0 :: Sending A Variable To A Class Function?

Oct 11, 2009

I have two classes one called 'LoaderSwf.as' which is used to talk to all the other classes im using. I also have a 'GeneralTimer.as' which works fine from a stand alone GeneralTimer.swf' file. What I am trying to do is send a value of 10ms to the GeneralTimer.as' which will then run the timer and when complete send a value back. But for simplicity im trying to send a ms value to trace("tick") and trace("tock").I keep getting error "TypeError: Error #1034: Type Coercion failed: Cannot convert 10 to GeneralTimer." this is according to Adobe "1034 Variables cannot be native." What does that mean for starters?Here's my code:in LoaderSwf.as

Code:
var w:Number = 10;
GeneralTimer(w);

[code]....

View 3 Replies

Flash :: Sending Variable From Fla To Document Class And Then Accessing?

May 31, 2011

I want to find out whether my swf was loaded locally or from another swf. For this purpose I have declared a variable 'parentType' in my fla. var parentType:String = String(parent); There is a function in the document class that determines whether swf was loaded locally or from another swf. The name of the function in the document class is 'externalOrInternal'. The varaible parentType is passed as a parameter to the function externalOrInternal externalOrInternal(parentType); The name of the document class is Main. In the constructor of Main I have the function pollResize() (the use of this function is to listen for the resizing event. That part of the code is not shown in the snippet given below).

[Code]...

I see that swfParentType is has value insde the function externalOrInternal. My doubt is why null is traced inside the function pollResize. Why is it not [object Stage] as inside externalOrInternal. Due to this I am not able proceed further with the stage resizing event.What needs to be done so that proper value is traced in the function pollResize.

View 1 Replies

ActionScript 3.0 :: Sending A Class Instance Reference To A Different Class Instance?

Apr 14, 2011

I'm creating a little game - The player controls a character that follows the mouse. Pigs run away from the player, and the player has to get them all into a pen. To make the game a little more difficult I'm trying to add an enemy - wolves, that attempt to perform a 'hunt' method every x seconds. This method sends a reference of the wolf instance to Main (my document class) and Main then loops through the pigs on stage to see if there's any nearby. Now as far as I know this works - my problem is I'm unsure how to send the pig instance reference back to the wolf that called the hunt method, so it can then 'target' the pig, and then attempt to pounce on it.

This is my Wolf class:

Code:
package
{
import flash.display.MovieClip;
import flash.events.Event;

[Code].....

View 7 Replies

ActionScript 3.0 :: Sending A Value From A Class Back To The Maintime Line & Calling A Method

Sep 22, 2009

I'm now finding the great need for classes as my current project is getting quite gummed up with too much scripting in the main document. Becoming a real pain to find stuff with in my code.

So I started writing a class to takes an id passed to it from the main time line, accesses my mySql DB, pulls the related info and the processes it. What I can't seem to figure out, is how to pass a variable back to the main time line. The traces all work, so I know my class works. I've searched here and via google, but I must not be searching the right stuff because I get a lot of results with are usually very complicated questions that don't yield the answers I need.

so here we go. my main.fla (and question):

Code:
import Name;
var theUserName:String = "Joe";
var processName:Name = new Name(theUserName);

[Code]....

ps: what's it called when trying to call a method from the main time line? or passing a property back to the main? are there specific terms for these?

View 10 Replies

ActionScript 3.0 :: ArgumentError: Error #2108?

Nov 6, 2010

When ever I test my project it comes up with "ArgumentError: Error #2108: Scene Bio was not found." Here is my code:

navMenu.navBio.addEventListener(MouseEvent.CLICK, navBio1);function navBio1(event:MouseEvent) {gotoAndStop("BioPlay","Bio")}

View 4 Replies

Actionscript 3 :: ArgumentError: Error #1063?

Sep 14, 2011

I'm getting the following error after testing my Flash game's code:

ArgumentError: Error #1063: Argument count mismatch on RestartButton(). Expected 1, got 0.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()

[code].....

View 1 Replies

ActionScript 3.0 :: WriteObject Throws An ArgumentError?

Feb 6, 2010

What's wrong with my code(see below)? An ArgumentError (message: Error #2004: One of the parameters is invalid) is thrown by writeObject and is caught in AbstractInvoker.invoke.

[Code]...

View 7 Replies

ActionScript 3.0 :: ArgumentError: Error #1063?

Sep 17, 2009

I am trying to use the onMouseWheel methodFirst I wanted to check if my event listener and event handler work

stage.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel);
private function onMouseWheel():void {
trace ("onMouseWheel()  method");

[code].....

View 3 Replies

ActionScript 3.0 :: ArgumentError 2109 While Clicking The Button?

Mar 4, 2009

using this:

[Code]...

I get this error when I click the button: ArgumentError: Error #2109: Frame label NaN not found in scene Scene 1. at flash.display::MovieClip/gotoAndPlay()

at Untitled_fla::MainTimeline/onClickNextSlide()

View 3 Replies

Flex :: ArgumentError: Error #2025 In ItemRenderer

Jul 9, 2010

I've got a problem in an ItemRenderer in Flex 3.5. I've looked at the other posts regarding this error but still can't figure it out. The ItemRenderer is part of an AdvancedDataGrid who's data provider is HierarchicalData. I'm getting the ArgumentError but the trace doesn't go to any of my code. I've gone through in debug mode tons of times but it looks like it doesn't happen until after my code runs. Quite strange.

The item renderer has a couple different parts. It figures out what row it should be drawing for based on the xml data and then adds labels and sprites appropriately.

Here is one of the methods that gets called if the itemrenderer is on a certain row.

private function addLabels(planList:ArrayCollection):void {
height = 0;
var sprite:Sprite = new Sprite();
var curX:Number = (width / planList.length);

[code].....

View 3 Replies

Flex :: ArgumentError: Undefined State 'normalAndInactive'?

Oct 29, 2011

I have a webapp that works great. I am now trying to make a desktop version for our internal use. I've converted it and changed the tag to a "WindowedApplication". When I try to run the Air app I get the error:

ArgumentError: Undefined state 'normalAndInactive'.
at mx.core::UIComponent/getState()[E:dev4.5.1frameworksprojectsframeworksrcmxcoreUIComponent.as:10596]

[code]......

View 2 Replies

Flash :: ArgumentError: Error #2015: Invalid BitmapData?

Jan 9, 2010

I am having problems loading a bitmapData. I am getting the following error

Engine Init //trace
loadimage//trace
ArgumentError: Error #2015: Invalid BitmapData.

[code].....

View 5 Replies

ActionScript 3.0 :: Video Player ArgumentError: Error #2126

Jul 20, 2011

have an ERROR message is

Code:
ArgumentError: Error #2126: NetConnection object must be connected.
at flash.net::NetStream/ctor()
at flash.net::NetStream()
at videoplayer1_fla::MainTimeline/initVideoPlayer()

[code]...

where to put the rtmp server path? and changes.

View 2 Replies

ActionScript 3.0 :: On-demand Video Player ArgumentError: Error #2126

Jul 18, 2011

I have a ERROR message is

[Code]...

Below code is xml playlist included. But i want to play videos through "rtmp server". My On-demand Video Player Code

[Code]...

View 8 Replies

ActionScript 3.0 :: ArgumentError: Error #2108: Scene LevelSelect Was Not Found

Mar 17, 2012

I am a new student and recently I am getting this error in every program that I write or import into Flash:

ArgumentError: Error #2108: Scene * was not found
at flash.display::MovieClip/gotoAndPlay()
at _5_fla::MainTimeline/clickPlay()

It doesn't matter what the scene name is because I have tried cutting and pasting the scene name from the scene window and it happens on every button in every program..

[Code]...

View 4 Replies

Actionscript 3 :: ArgumentError: Error #1508: The Value Specified For Argument Font Is Invalid

Jan 19, 2010

I have an air application that loads an external swf when prompted by the user. In the external swf, I have a class that loads all the necessary fonts for that particular swf. When my air application attempts to load the swf I get ArgumentError: Error #1508: The value specified for argument font is invalid.

View 1 Replies

Actionscript 3 :: ArgumentError: Error #2025: The Supplied DisplayObject Must Be A Child

Jul 27, 2010

I am encountering the following error message whenever I compile my project in Adobe Flash CS4:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at stageRotation/spawnParticle()

[Code].....

View 2 Replies

ActionScript 3.0 :: ArgumentError: Error #1063: Argument Count Mismatch

Jun 19, 2010

I'm working on adding a difficulty setting to my platofrm-type game but I got an error and cant figure out what's actually wrong. I'm trying to click anywhere on the stage to take you to the next scene.The error says:

ArgumentError: Error #1063: Argument count mismatch on LevelKey(). Expected 3, got 0.
at flash.display::MovieClip/gotoAndPlay()
at Engine/NormHandler()[Engine::frame3:55]
ArgumentError: Error #1063: Argument count mismatch on Engine/startGame(). Expected 0, got 1.

And my entire code for the scene is:

Code:
stop();
stage.addEventListener(MouseEvent.CLICK, startGame)
function startGame ():void {

[code]....

View 5 Replies

ActionScript 3.0 :: ArgumentError: Error #2025: The Supplied DisplayObject Must Be A Child

Aug 30, 2010

im aworking on a game. There are 6 tables in the game. when i click on a table, a box pops up(done by addChild).There is also a code that spawns people randomly to sit at the various tables. The code extends a mc that contains all the people(personholder). The when i play the mc, the menu appears to be behind the people and i cant click it.It also results in an argument error in the output. I fixed this by adding this line:

Root.addChildAt(guy1,Root.getChildIndex(Root.main)-1);

after this line:
Root.addChildAt(guy1,Root.getChildIndex(Root.quizc ont)-1);

main is my table container.quizcont is my quiz container. these lines are to make the quiz and table/menu clickable. however, thay also appear in front of the people. how do i send them back? also, i get the arguement error after sometime, but it does not affect gameplay.

View 1 Replies

Flash 10 :: ArgumentError: Error #2108: Scene Subnav Was Not Found

Mar 9, 2011

i have a game im making but it is useing scenes to navigate between pages. every time i click on a button i have created, it gives me this code:

ArgumentError: Error #2108: Scene subnav was not found.
at flash.display::MovieClip/gotoAndPlay()
at buttontesting_Fight_fla::ryusrevenge_17/mv1()

it does this for every scene i have. I even made the buttons in the begining and made them invisible so that they were in the entire time line but not usable or seen till the end of the time line. I dont know what could be going wrong.here is the rest of the code i have for one of my scenes.

import flash.display.*;
import flash.events.*;
import flash.display.FrameLabel;

[code]....

View 0 Replies

ActionScript 3.0 :: ArgumentError: Error #1508: The Value Specified For Argument Font Is Invalid

Aug 6, 2007

var loaderContext:LoaderContext = new LoaderContext();
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
var loader:Loader = new Loader();

[code]....

in the server all is working good.compile from local Main.as heres my error

ArgumentError: Error #1508: The value specified for argument font is invalid.
at flash.text::Font$/registerFont()
at Fonts$iinit()

View 4 Replies

ActionScript 3.0 :: ArgumentError: Error #2108: Scene Main Was Not Found

Jan 3, 2012

I'm having trouble jumping to another frame (15) in the main stage named "main" when closing a movie clip on frame 10..

ArgumentError: Error #2108: Scene main was not found.
at flash.display::MovieClip/gotoAndPlay()
at welldone_mc/nextlevel_function()

the actions are as follows:

stop();
nextlevel_btn.addEventListener(MouseEvent.CLICK,ne xtlevel_function);
function nextlevel_function(evt:MouseEvent):void {
gotoAndPlay(15, "main");
}

i've tried labelling the frame, but the problem seems to be locating the scene "main"?

View 8 Replies

ActionScript 3.0 :: ArgumentError: Error #2082: Connect Failed Because The Object Is Already Connected

Jan 21, 2009

I have seen a few posts on this topic and I have tried wrapping the lc.connect attempt in a try/catch block. My goal is to be able to open my app (a cfm in which swf's communicate w/ each other using localConnection) in multiple browsers without receiving this error.

View 0 Replies

ActionScript 3.0 :: ArgumentError: Error #2025 : The Supplied DisplayObject Must Be A Child Of The Caller?

Jul 6, 2009

I have set up a series of buttons that show an image when rolled over and then the image disappears on roll out. A sample of the code I am using is below:

costume_btn.addEventListener(MouseEvent.MOUSE_OVER , loadCostume);

function loadCostume (e:MouseEvent):void {
var newCos:feather = new feather ();
this.addChild(newCos);[code]....

It works fine first time through but on roll out the second time you visit any button it gives me the following error message:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display:isplayObjectContainer/removeChild()
at MethodInfo-12()

View 4 Replies







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