ActionScript 3.0 :: Error #2136 When Making New Object
Feb 7, 2008
I just want to use some variables out of another class, but when i make a new instances using the code from the error-class i get this error:[code]
this last class Game2 is used as document class.
View 2 Replies
Similar Posts:
Dec 22, 2010
in Flash CS3 I've this DocumentClass:
package { import flash.display.MovieClip; public class DocumentClass extends MovieClip {
public function DocumentClass() { trace("document class created"); } }}
This actually works, but I want to have the possibility to re-instance the DocumentClass (because I want to restart a game and the Main class is the DocumentClass).In the first frame I have:
import flash.events.MouseEvent;
btn.addEventListener(MouseEvent.MOUSE_DOWN, restart);function restart(evt:MouseEvent){ var d = new DocumentClass();}
But this code (I simplified my situation, but the result is the same) throws an error:
Error: Error #2136: The SWF file file:///E|/Documents%20and%20Settings/Pepper/My%20Documents/FlashDeve lopment/PepperGame.swf contains invalid data at DocumentClass/restart()/frame1()
What can I do to restart my game by calling the DocumentClass point of entry? Is this possibile?
View 4 Replies
Sep 3, 2009
I created something that'll allow me to have a character and walk with it, but I did this all in the document class. And because this is going to be more complicated I wanted to move that to a Character class. So I did this:
[code]...
Now the issue is when is on the line in my character class that calls the new Character(); Because when I comment it out, I don't get it anymore.I get this error: Error: Error #2136: The SWF file ..../vs.swf contains invalid data.at VelunaStory()I don't think it's anything inside the Character class because I tried commenting out all the functionality so it's just a shell of a class and I still get this error.
View 7 Replies
Dec 16, 2009
I am getting runtime error #2136 'The SWF file at %1 contains invalid data' (I know, %1 is a reference to the file producing the error) All I did was change some button graphics to movie clip types and have solved all the type mismatch and other syntax errors. This is a file I have been working on and posting about. This is getting annoying. What would be causing this type of error??
View 8 Replies
Apr 26, 2010
I have two classes. One is my Document Class, and another extends my Document Class. It doesn't work, and gives me this error "Error #2136: The SWF file MyGame.swf contains invalid data."
View 4 Replies
Dec 22, 2010
I built a little game in the spare time.I've a DocumentClass and four other classes. Once I realized I could not restart the game when finished playing, I thought I should create a new instance of the main class (DocumentClass) to launch it again.The problem is that, by doing so, I get Error #2136,"The SWF file contains invalid data". What happens?
View 1 Replies
Dec 16, 2009
I have a problem with creating instances from classes created from embedded data taken from an external .swf which has loaded into its library various images exported to ActionScript as BitmapData.What confounds me is that, of 22 images that I'm loading, 14 of them work fine and can be instantiated and displayed to the screen in a test program. The rest of them throw Error #2136, "The SWF file contains invalid data."I'm using Flash CS4 with Flex 3.4.
-----
Attached is a .zip of a few files:
library_tester.fla - contains the code for testing the library
Assets/GridGame/grid_Library.fla - contains the library
[code]....
Right now, the code in library_tester hits the error when it attempts to create Logo after creating two other variables set onto the stage.
View 3 Replies
Oct 13, 2010
my title explains what im need but im using flash cs4 and heres what i have so far:
var centerX:Number;
var centerY:Number;
var centerZ:Number;
[Code].....
ok so RBall is my first moving object and my orbiting object will be called orbit
View 9 Replies
Oct 31, 2009
I am working on sound.Error: Error #2029: This URLStream object does not have a stream opened.Error occured during the sound.close()
View 2 Replies
May 4, 2010
I added a flv into my Scene 1 then i added a new Scene.I just wanted to after finishing the .flv flash go to next scene.but when i added a new scene,and I test my movie,the .flv didnt show and i recieved these errors
[Code]...
View 5 Replies
Mar 10, 2009
This is my code,
stop();
button3.addEventListener(MouseEvent.CLICK, playClick3);
function playClick3(Event:MouseEvent):void {
gotoAndStop(422);
}
On frame 422 there is no code at the moment. I keep getting the error TypeError: Error #1009: Cannot access a property or method of a null object reference.
View 2 Replies
Feb 11, 2009
I was following a tutorial for a Pre Loader. I keep getting this error...
Error 1119: Access of possibly undefined property bytesLoaded through a reference with static type Class.
View 4 Replies
Oct 1, 2007
I am trying to use the scroll pane component and I am having a few teething troubles. I have a scroll pane as a child object of a movie clip which is essentially a 'page', if I display this page it works fine and the scroll pane does too. If I then remove this page from the display list, go to another page and come back by readding it to the display list, I get the following error, even though nothing else has changed:
TypeError: Error #1009: Cannot access a property or method of a null object reference.at fl.containers::ScrollPane/fl.containers:ScrollPane::endDrag()
The scroll pane is still visible and works correctly, but ideally I'd like to stop this error.
View 3 Replies
Jun 11, 2009
this is the error [code]And the frame labled homeMenu_MC.i can't seem to figure out what is going on, i'm still pretty new to AS3 and AS period so I'm not sure exactly what the "child" is.All I know is it loads and the btn glow works right the menu just doesn't come up when your roll over the navBar_mc everytime i roll over it i see in the output the error code.
View 2 Replies
Jan 30, 2009
Im making a site and i have this error:
ActionScript Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Site/fadeItens()
at Site/::menuWork()
[code]...
View 2 Replies
May 23, 2008
I have a site that manage uploads for our content providers, but when you run the flash movie and you start uploading a file, somewhere is the middle of the upload, a message pops saying that a script in the movie is making the flash player to run slow, and thta you computer may turn unresponive, after googling for this error i find out that my script may have a infinitive loop or function, i've been tryint to find the error on my scrip[code]....
View 3 Replies
Feb 16, 2005
i'm making an animated rollover, and i get an output error that says this: Target not found: Target="_root.icon01" Base="_level0" i have no idea what the base="_level0" means.
View 1 Replies
Jun 8, 2004
So far I've worked out moving sideways and collision detection, which were both pretty easy.What I need to figure out is how to make my movie clip jump. I have a jumpheight variable set at 50, so I want the Y value to increase gradually until it peaks 50 pixels from where it started, then gradually come back down until it collides with a solid object. But I can't really figure out how to do that. I've got this:
Code:
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL)) {
[code]....
View 5 Replies
Dec 9, 2011
When I test my movie, I'm getting this error: TypeError: Error #1010: A term is undefined and has no properties. I think it's caused by child objects but I couldn't fix it. My code:
var wPawn1:Object = new Object();
wPawn1.mc = new WhitePawn();
addChild(wPawn1.mc);[code]...........
View 1 Replies
Mar 7, 2010
So how to make a colored shape/sprite completely black? Like when a medal hasn't been obtained yet.
View 2 Replies
May 19, 2005
How to make sure the sheep will only appear on the green field on the left hand side? I use the following but they appear all over the place.
onClipEvent(load) {
_x=Math.floor(Math.random()*379+150) //where width is the width of your stage
_y=Math.floor(Math.random()*376+150) //where height is the height of your stage
}
View 1 Replies
Feb 2, 2007
How do i make Obj1 move to Obj2 without easing? I want it to move Obj1 to Obj2 "walking" not "directly" by setting its _x and _y values.
Example for code with easing:
onClipEvent (load) {
_x = 0;
_y = 0;
[Code].....
View 8 Replies
Jan 1, 2010
Say I am moving an object around on the stage, walking from point A to B across the stage. I want to make the object the center, so the stage is centered on the object, so when I walk from point A to B the stage moves with me.
View 5 Replies
Feb 2, 2010
I'm interested in making an object that implements IEventDispatcher.
Does anyone know what the goes in addEventListener(...) dispatchEvent(...) etc. ?
My goal is to create my own simple Button that listens to mouse events, not 100% sure about the entire process (probably use hitTest and a single invisible pixel to trigger mouse events), this object extends BitmapData (Not an IEventDispatcher) so i have the option to use pure pixel rendering + mouse control.
View 5 Replies
Jun 26, 2011
I'm newbie in Flash and action script, just start learning T__T...
onClipEvent (load) {
speed=10;
} onClipEvent (enterFrame) {
if (key.isDown(key.RIGHT)) {
_x+=speed;
} else if (key.isDown(key.LEFT)) {
_x-=speed;
} if (key.isDown(key.UP)) {
_y-=speed;
} else if (key.isDown(key.DOWN)) {
_y+=speed;
}}
Is that making the object moving to left and right?
View 3 Replies
Jun 13, 2011
I get following error occasionally while running my flex application. I dont know what is wrong as it works intermittently.
Error occured (mx.messaging.messages::ErrorMessage)#0
body = ""
clientId = "DirectHTTPChannel0"
[code].....
View 1 Replies
Nov 30, 2009
Im trying to make a character get propelled upwards when he steps inside a bubblejet, but as i am very new to actionscript i have no idea where to start. heres what im trying to do:I hope that makes sense! im sure it will be a simple thing to do just i really am clueless!
View 2 Replies
Jul 13, 2010
It is a website for my dad and i decided to take this opportunity to learn flash. I made the nav bar using a tutorial i found from youtube and the code is this
Code:
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
[Code].....
View 5 Replies
Sep 21, 2011
Im trying to make a character get propelled upwards when he steps inside a bubblejet.
View 7 Replies
Mar 26, 2009
I'm creating pages with text supported by wav files for training. on the bottom of the page is a progress bar. I want to make a button that when clicked will permenantly
raise the alpha of a movie clip (on a different layer) to 100%. (it is currently set to 0) within the movie clip (hazpop) is a button that will turn the alpha to zero (click to close window) so in theory (not as2) it should be: on mousedown alpha.hazpop=100 I've been combing the forums for days and no-one is talking about alpha.
View 3 Replies