ActionScript 3.0 :: Code Work In One Place But Not Another?
Sep 16, 2011
I have a class. Inside the class are two public functions. One calls this:
MovieClip(root)["bmc"+PuzzleGlobals.puzzleAbbrev].addChild(this);
And the other calls this:
MovieClip(root)["bmc"+PuzzleGlobals.puzzleAbbrev].addChild(fwgame); fwgame is declared like this (before the addChild): var fwgame:FireworkGame = new FireworkGame(); trace (fwgame); //traces correct object
trace (MovieClip(root)["bmc"+PuzzleGlobals.puzzleAbbrev]); //returns a 1009 error
The first line of code works. The second line returns a 1009 error, "Cannot access a property or method of a null object reference."
View 6 Replies
Similar Posts:
Jul 10, 2003
I have attached a simple test fla.I am trying to centralize my code in all my movies using dot notation instead of spreading my code all over the place. It never works, I must be doing something wrong.The test .fla has a movieclip with a timeline animation. I used the linkage identifier to name it 'reload' AND named the instance 'reload'.
_root.reload.onRollOver = function() {
this.gotoAndPlay(2);
}
The pointer doesnt even change to a hand.
View 4 Replies
Apr 12, 2010
if i make a new fla movie, and place this code on the first frame
Actionscript Code:var txtFile:String = "http://localhost/php/Portfolio/home.txt"; var urlRequest:URLRequest = new URLRequest (txtFile); var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, loadHandler); loader.load(urlRequest); function loadHandler(e:Event):void [code]....
View 1 Replies
Dec 12, 2011
how do i place several level in this source code ??
View 2 Replies
Feb 14, 2010
I would like to hear from experienced AS3 users: are there any kind of rules or 'good behavior' on where to place a code for files. Should one use *.as files instead of frames to place code? I mean, yes *.as file is pretty easy to track and modify. But there are a lot of stuff that could be done using frames.
View 5 Replies
Oct 3, 2010
Can I place all of my .fla AS3 code in a class called main.as?I dont want to run my as3 project from the .fla but how do I start the main.as?my .fla file looks like this and I dont know how to put this into a class?Do I simply do this in line 1 of fla file?
var mymain:main=new main();
Code:
var noLoaded:int;
noLoaded=0;
var li2:ClassImg6= new ClassImg6();
li2.addEventListener("image_loaded",imageLoadedHandler);
[code]....
View 1 Replies
Mar 27, 2010
I'm developing a G.U.I 'drag & drop' code module to place and replace 3D objects on a 3D object.
View 1 Replies
Apr 18, 2011
I have to use the old drag and drop code on my movie clips, but the problem is when I drag the movieclip to the area on my .swf file once i release it, it sticks to the hand mover.I am encloseing the action script I am using could someone or kglad tell me what is missing from the code so that once it is released it will not stick, see code belowcircle.onPress = function(){ startDrag(this);}circle.onRelease = function(){ stopDrag();}
View 3 Replies
Mar 24, 2004
I place the code in the timeline but I dont know where to place them to make the movie clips work?
* do i have to place them on the time line?
* Do the have to be named a certain Way ?
* Do they have to have some code ?
View 2 Replies
Feb 1, 2011
How to make this smoke effect work without mouse input. I am trying to have it spill from the end of a cannon, & my attempts to modify the position have resulted in all my bitmaps shifting. I changed this
doTrail(_root, _xmouse, _ymouse, currentBitmap);
To this
doTrail(_root, _x=80, _y=100, currentBitmap);
[Code] .....
View 0 Replies
Feb 19, 2010
public function GlobalSolutions()
{
Navigation(' Home ', 'index', 235, 0x97F9EC);
Navigation(' Office Supplies ', 'Office_Supplies', 295, 0x97F9EC);
[code]....
I want to remove the appropriate child (e.currentTarget) and create a new child in its place with the next line, but it doesn't work. What do?
View 13 Replies
Apr 8, 2005
how can i duplicate a movie clip and then place it on a certain place on the stage
View 5 Replies
Aug 21, 2010
I've used .x = and .y = with the position I want and the pane continues to show up in the top left corner instead. What am I doing wrong?
View 2 Replies
Mar 7, 2008
how can we place hundreds of instances of one movieclip on different place?
for exemple, pacman:
how should i code the placement of all the money?
i would go:
_root.attachMovie(
_root.attachMovie(
_root.attachMovie(
but that's not the good solution is it?
there must be a code to do that without hundreds of lines of code.
View 3 Replies
Oct 17, 2010
Code Snippets won't workEvery time I try to attach a Code Snippet I keep getting this error:***Notes from Customer***10/13/201020:55:30When I have a object on stage, and I try to add code snippet, I keep gettingerror message: The following JavaScript error(s) occurred: SyntaxError: missing ) after argument listI've watched video(s) on adding snippets, but it won't work for me like it
View 1 Replies
Jun 24, 2011
I am using AS2 and I am trying to make a simple 'game' for an assignment for school.I am first trying to make a simplified version of the game, to get some experience before I make the final version.
I will try to explain this simplified version:
The player has to drag an object in a big square and then release it. The object resamples 20 liter water. In total the player has to drag 100 liter water to the square, so it has to drag and drop the 'water' object 5 times.
I want some text in screen that says: You still need .
[Code]...
View 13 Replies
Nov 12, 2005
When i move some MC or elements between fla movies, with the code, frames, and layers it need to work, some code stop to work?
View 10 Replies
Apr 25, 2009
Okay, I know this is an old topic by now. I've searched numerous places how to save to a simple text file, and at one point in my life I was able to do it. However, the code doesn't seem to work anymore Flash Code:
Code:
myData = new LoadVars();
submit.onRelease = function() {
[code].....
View 10 Replies
Jun 11, 2009
For some reason my buttons don't work when I stop on frame 34. Everything else works, but when I stop on 34 the button/actions won't work anymore. I have no idea why. I checked everything that I can think of. The buttons are labeled correctly on the frame.
Here is the code:
stop();
button01.onRelease = function() {
if (_root._currentframe == 1) {
gotoAndPlay(2);
[code]....
View 2 Replies
Mar 16, 2009
What I'm Trying To Do: Modify the y coordinate of a MovieClip on the stage from an external .as File, simple as that.If someone could tell me why its not working and how I can go about fixing it without modifying the existing class structure
(ChildOfMain must subclass MainClass).
Download
Source Files 6 kB
For those of you who don't want to download the source files (I thought it would make it easier if you could handle it yourself)
Document Class For Project: Main Class
Objects In Project Library
platform (movieclip)
subjectMovieClip (movieclip)
[code]....
View 6 Replies
May 11, 2010
im using the following code:
stop();
btn_arrow_TL.addEventListener(MouseEvent.CLICK,l1top);
function l1top(l1:Event)
{
gotoAndPlay("left_flyout_play_1st");
[Code]...
The first two buttons (btn_arrow_TL and btn_arrow_RL) work... but btn_Home will not work.... it shows up just a few frames later in the timeline, but why would this have any effect on it working or not??? The ActionScript runs the whole length..
View 1 Replies
May 5, 2011
I've tried removing or using this and code dose not work.
[Code]....
View 2 Replies
Dec 11, 2011
In other language I can use this kind of sentences:
[Code]....
How can achieve this? because the above code does not work.
View 1 Replies
Sep 2, 2010
I have the following code:
package ;
import flash.display.DisplayObject;
import flash.display.Graphics;
[code].....
View 2 Replies
Nov 3, 2010
However, they work in other examples, even locally, when I download the source.
Code:
//Button
on(release)
[code]........
View 1 Replies
Sep 27, 2009
ok, so i am doing a tutorial on external text sheets, but i cannot seem to implement the same code into my current project, it just doesn't seem to work.Its strange because im not getting any errors, but it still doesn't work.This is the example code:
Code:
var loader:URLLoader = new URLLoader(new URLRequest("my_text_file.txt"));
loader.addEventListener(Event.COMPLETE, completeHandler);
[code].....
View 5 Replies
Jul 16, 2010
Every time I preview my .swf in flash I can see everything resizing correctly as well as staying centered on the page. However when I uploaded it to the web none of it works anymore and I have no idea why.Check it out...
pixelflexstudios.com/test/test.html
.swf code:
ActionScript Code:
[code]....
View 9 Replies
Feb 28, 2009
I have used a pop up window code several times before and now it doesn't seem to work. I've tried in several different movies now and when pressing the button it simply flashed the page and moves a little, but won't actually pop up to the page it's pointed to.Here's the code:
on (release) {
getURL ("javascript:NewWindow=window.open('http://www.angelfire.com/in/HansonArtGallery/2newpaintingbig.html','newWin','width=650,height=6 50,left=0,top=0,toolbar=No,location=No,scrollbars= No,status=No,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");
}
View 1 Replies
Dec 19, 2010
I have a Rectangle Box called (Panel1_mc).And inside it there is a button called (BoardMessage1_btn). When I click on this button, the Rectange Panel should move upwards. Right now it is on the bottom of the page. The following code throws an 1010 error:
Panel1_mc.BoardMessage1_btn.addEventListener(Mouse Event.CLICK, clickSection);
function clickSection(evtObj:MouseEvent){
var Panel1Tween:TweenMax = new TweenMax(Panel1_mc, 6, {y:450, delay:1, ease:Strong.easeOut});
}
What is wrong with this code?
View 1 Replies
Jul 21, 2011
I have the following code with type writing effect which is working cool. But I want this code to start after 30 seconds so that some of the animation will be finished playing animation.[code]
View 7 Replies