Actionscript 3 :: Flash Error 1151 In A For Loop?
Jul 25, 2010
I have a strange problem regarding Flash error 1151: A conflict exists with definition i in namespace internal.Here is the problematic code:
for(var i:Number=dt.getFullYear(); i >= dt.getFullYear()-90; i--)
{
dtYear.addItem( {label:i, data:i} );
} //for
[code]....
You cannot declare more than one variable with the same identifier name within the same scope unless all such variables are declared to be of the same type. In ActionScript 3.0, different code blocks (such as those used in two for loops in the same function definition) are considered to be in the same scope.
What the friggin hell is this? I mean the i variable is all the time exists as a Number, typecasted as a Number, why the hell would the above code then fail?
Working code:
for(var i:Number=dt.getFullYear(); i >= dt.getFullYear()-90; i--)
{
dtYear.addItem( {label:i, data:i} );
} //for
[code].....
View 2 Replies
Similar Posts:
Jun 16, 2010
I have wrote a function like ,
private function addSelectedFunc():void
{
/**
[code].....
View 1 Replies
Nov 26, 2011
i have been working on a reaction timer and i need to run the same program multiple times but put in different colored squares (when the square shows up click stop to get time) to see if that effected the reaction time so i made a bunch of seperate files with the different colors but i wanted to combine them and after i combined them i had a bunch of duplicates and i got those fixed but i still have error 1151.
i have the same text thirty times and where the numbers and myy is they are to get rid of duplicate terms
var blueSquare=new blueSquare();
timeline 1
stop();
var myy1Timer = new Timer(2500);myy1Timer.addEventListener(TimerEvent.TIMER, blueSquareDelay1);myy1Timer.start();
var blueSquare = new blueSquare();
[code]....
if you are planning on building it to test i have three buttons the stop start and reset with the instances stop_btn etc. then there is an adaptive text box with instance of myText_txt i also have not put time in to get the start and reset buttons working it just starts on its own.
View 8 Replies
May 8, 2010
I am trying to embed a font. It is the same font but, different sizes ( I dont know if that matters, one size is 11 the other is 15). I set up my actionscript as so (please see below), but I continue to get this error message: 1151 A conflict exist with definition dtText2 in namespace internal. WHAT I AM DOING WRONG? And do I need another set of code if I am using the same font but instead of size=15; I am using size=11;?
var font3:Font=new Font3();
var dtFormat:TexFormat=new TextFormat();
var dtText2:TextField=new TextField();
dtFormat.Font=Font3.fontName;
dtFormat.size=15;
[Code]...
Why is it giving me error 1151 A conflict exist.....? I have tried changeing the name of my var dtText2, and I even instance my dynamic Text, naming it myText2 but I continue to get errors.
View 5 Replies
Apr 21, 2009
Keep getting this: 1151: A conflict exists with definition my_flvPb in namespace internal.
The AS is:
import mx.video.FLVPlayback;
var my_flvPb:FLVPlayback;
my_flvPb.autoPlay = false;
my_button.label = "Seek to point2";
[Code]...
View 1 Replies
Oct 27, 2011
I am developing an application where the user chooses the game he wants to play. In my main timeline I have a different layer for each game(movie clip). Movie clips - games - have some common function/variable names with totally different implementation.
When I try to compile I get the :
Code:
...1151: A conflict exists with definition iArea in namespace internal.
I unchecked 'Automatically declare stage instances' option on stage settings.There are 30 errors of this kind and there will be 6-7 games so coming up with different names will be a real pain.
View 3 Replies
Jun 26, 2008
i dont know if its me but have things got alot more complicated? i have made 4 .swf's that all work fine individually. i have 4 scenes that each .swf is to load into and play in turn when the main movie loads in.before the loadmovie code was:
stop();
unloadMovieNum(2);
loadMovieNum("fcbp01.swf", 2);
now however i have been advised to use:
var request:URLRequest = new URLRequest("achange.swf");
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);
this does not work and i get the error code: 1151: A conflict exists with definition loader in namespace internal.var loader:Loader = new Loader();.
View 3 Replies
Oct 16, 2011
I already have a couple discussions active regarding some duplicate script troubles I am having, but felt I needed to start a new one... I have two slideshows inside of one Flash site. I have been receiving "duplicate function definitions" all over the place as a result of both slideshows having similar script. I've managed to remedy most of these with some different naming devices. But I am not sure how to get around this latest....
The latest is a 1151 error "A conflict exists within definition xmlReq in namespace internal." for the clearing that up, Flash! These are the two conflicting lines of script - which reside in separate "label" sections actions layers - below. I am not sure why I'm getting an error, as you'll see I've got distinct xml file names in them:
[Code]...
View 8 Replies
Apr 3, 2007
I am migrating one of my project to AS3.I have a structure of one main movieclip attached to class MainApp, which is having some movieclips each of those attached to some classes (say MyItem class). Now I am getting two problems,
1. I have some simple movieclip in my MyItem movieclip. The instance name say bg_mc. Now in my MyItem class in AS2 I used to write something like : private var bg_mc:MovieClip;
and then make visible true or false depending on some action.If I am trying to do the same in AS3, it is showing me error saying :
"1151: A conflict exists with definition bg_mc in namespace internal."
If I am attaching the movieclip using addChild then it is fine. But for my app this will be a hectic job as I have atleast 40 of such items and the shape are different. So I have manually placed those movieclips inside whatever designers have given me. Can't we have simple movieclips in a AS3 class without doing addChild?how to call a method from MyItem to MainApp.In AS2 I used to call something like
_parent.onItemSelection (this);
In AS3 the same is throwing some error though I have the method in my MainApp.as file.Both my classes are extending MovieClip class.
View 8 Replies
Jan 18, 2010
Iam trying to control my sound via AS3. My code looks like this:
[Code]...
I gives me an error code:1151: A conflict exist with definition mysound in namespace internal. I and also the website doesn't function properly like my intro movie doesn't play and then it skips thorough everthing else.
View 5 Replies
Dec 7, 2010
I have a flash loop with a function inside (nothing special, just looks through some text files on hard drive). However, some of the files don't satisfy, this is expected and the program throws an error as expected. No surprises there.But! I would like it to move on to the next text file when it finds a bad text file. Instead, it just stops everything.[code]
View 1 Replies
Jul 25, 2011
Code: I have a very simple flash video, with a strange problem that I understand how to resolve normally, but not when it pops up on the second run. Basically I have a scrolling banner with 4 panels that all link to different site. The panels scroll across the stage, then move out, and the next banner comes across and so on. Not complicated at all. But all of the sudden I'm getting:
[Code]....
View 6 Replies
Oct 21, 2011
I have the following function constantly running to check for collision between a player-controlled ball (mcBall) and a number of walls (aptly named mcWall1, mcWall2, etc.): (the var numberofwalls gets its own value in each different frame where there is a different number of movieclips.)
[Code]....
View 1 Replies
Sep 2, 2011
1151 errors on about line 32 and 33, cant find the problem
View 9 Replies
Dec 5, 2010
I'm pretty dumb when it comes to AS3. I've never really done any coding before AS3, so it's pretty tough for me.
Anyways, this should be easy for someone nice to fix. This is just a simple timer that I can't get to work.
[Code]...
View 2 Replies
Nov 26, 2002
On very slow machines (>p200Mhz) I sometimes get an error that says "A script in the movie is causing macromedia flash player 6 to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?" Yes, No.
I have a loop function that populates a listbox, sometimes the file it loops from is over 2000 lines, and takes a long time for the listbox to populate. In this time I get the error. If I hit No on the error everything works just fine. I am almost for sure there is no problem with my script, flash just thinks the loop is set to infinity or something and pops open the error box.
View 2 Replies
Feb 2, 2012
I keep getting the #1009 error coming up, i checked that everything was on my stage and was named correctly.This is the error message that comes up:TypeError: Error #1009: Cannot access a property or method of a null object reference.at Videogame_fla::MainTimeline/loop()Here is my code:
var carrot:Number = Math.floor(Math.random() * 460) +0;
var carrot1:Number = Math.floor(Math.random() * 460) +0;
var carrot2:Number = Math.floor(Math.random() * 460)+0;
[code].....
View 2 Replies
Jul 15, 2010
which everything seems fine, but when i implement a slider on a page inside a folder in the root (i.e. aboutus/index.aspx) i get that error when the slider is trying to call the images.I have similar slider animations in pages located in the root folder and in those i get no problem at all, seems it only happens when the page is located inside a folder.The website is done using main.master on asp, maybe the cache or rendering of the website is missing something, hope someone has had something similar or know how to get around this.
View 2 Replies
Jul 24, 2009
"256 levels of recursion were exceeded in one action list.This is probably an infinite loop.Further execution of actions has been disabled in this movie."Why do I get this error (above) when I use the code (below)? Why isn't this acceptable? [I use function similar to this in Javascript with no problem.][code]
View 9 Replies
Sep 3, 2010
Here is my site sans looping video: [URL] I am setting my video up to loop. I used the following code:
__________________________________________________ ___________
[Code]...
View 13 Replies
Apr 30, 2010
I have been pulling my hair out on this one for too long. I have a web banner that uses Erik Hallander's Pixelator Class. Everything works fine when the timeline plays just once, but as soon as it loops I get error:
ArgumentError: Error #2015: Invalid BitmapData.
I have tried removeChild, removeEventListener, nulling the variables involved, disposing of the BitmapData. I also tried some conditional statements depending on the loop but no success. The actual class code is beyond my experience.
View 1 Replies
May 10, 2010
I'm trying to use the for each loop for the project I'm working on but this doesn't seem to work. "for" and "in" are terms recognized by flash (they turn blue when you finish typing them) but "each" does not. And of course I get a compiling error because the compiler does not recognize it. Did adobe change the wording of this loop?
View 1 Replies
Sep 30, 2011
I'm trying to do a binary search in a for loop. However, flash does not like the following for loop.
for(var select:int = Math.floor((min + max / 2)), var turns:int = 0;
turns < input.length / 2 + 1;
turns++, select= Math.floor((min + max / 2))){
if(input[select] > want){ max = select;
} else if (input[select] < want){
min = select;
} else {
return select;
}}
On the first line I get 1084: Syntax error: expecting identifier before var. I think I know why (I'm using , to separate the different statements), but how do I fix it? ; won't work since it's what the for loop uses.
( var select:int = Math.floor((min + max / 2)) ;
var turns:int = 0);
turns < input.length / 2 + 1; //etc
does not work either.
View 2 Replies
Jan 21, 2010
I have been getting the following error occasionally when running my flash file.Error #1502: A script has executed for longer than the default timeout period of 15 seconds.at Sr_fla::CenterTemperature_10/frame2()After the error occurs I can dismiss it and the error will not reoccur unless the flash file is closed and reopened - even though I am running the same code over and over.I have traced out all of my loops and feel confident there is not and infinite loop.I read a note on the forums that mentioned this error can occur when a large calculation takes place.I am doing some semi-complex calculations. Maybe that is the cause. Below I have posted some snippets of code from my work. Essentially I have a script which tests a variable (CenterTemperature) to make sure it is within certain bounds.Then a looping movieclip reads the variable and scales another movieclip accordingly.[code]
View 2 Replies
Jan 17, 2011
The following is the script for a button that is in my library (no instances onstage at start) which I need to be created from a for loop(courtesy of the excellent Henke37);
ActionScript Code:
package
{
[code]......
View 2 Replies
Apr 1, 2011
I have this error in my output screen, what it means?
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at soundboard_fla::MainTimeline/frame40()
at flash.display::MovieClip/gotoAndStop()
[code].....
View 1 Replies
Apr 28, 2011
What I am trying to do is open a database in async mode and get some data from my database. To do I wrote this code down below:
[Code]...
My startstmt is a global SqlStatement variable. When I tested in Sqlite Manager it works fine this query but in adobe-air i am getting this error. Where did i do wrong and how can I solve this?
View 1 Replies
Jul 10, 2010
I have been getting this Type Error 1009 at the following Loop:
ActionScript Code:
private function Loop(e:Event):void {
for(var i:int=0; i<walls.length; i++) {
if(hitTestObject(walls[i]) && hits > 0) {
explodeX = this.x;
explodeY = this.y;
[Code] .....
ActionScript Code:
parent.removeChild(this);
But that doesn't work. Still get the error
View 3 Replies
Feb 9, 2010
I'm writing an upload program to upload multiple files. It works great as long as I only upload one file but as soon as I add a second file it throws an error saying it can only perform one upload at a time.Is there a way I can have it not loop back through the for loop until the upload has completed?Here is a chunk of my code
Code:
for(var q:int = 0; q < selectedFileArray.length; q++)
{
trace("Loop marker 1");[code].....
View 4 Replies
Apr 4, 2011
So i have my items that I bring onto stage with my loop function with dynamic text fields within the loop. If I want to clear these items using a reset button on the stage how can I do this. From my code below when I press the reset button I receive: TypeError: Error #1010: A term is undefined and has no properties.So a little snippet of my code just to give an idea what I use to bring items to stage and what Im trying to use to reset[code]....
View 4 Replies