ActionScript 3.0 :: 1151 Errors In Lines 31 And 32?
Sep 2, 20111151 errors on about line 32 and 33, cant find the problem
View 9 Replies1151 errors on about line 32 and 33, cant find the problem
View 9 Repliesi 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.
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].....
I have been working on a map viewer based blitting technique. As part of the map I need to draw approximately 50000 lines and performance is currently really poor.
Code: Select allvar movie:Shape = new Shape();
for( ... )
{
movie.graphics.clear();[code].....
My code is on the main timeline.I call a function loop to draw lines between them.The lines are drawing between the right x, y values BUT between those values on the main stage, not those values within the kite.For example, dot1_mc is at x100, y0 inside kite. the line that should go from its center, draws from stage x100, 0.How do I draw the lines inside kite so that they draw between the dots?Heres my code that draws the linesPHP Code:
function loop():void{ lineDrawing.graphics.clear(); var a:Point = new Point(kite_mc.dot1_mc.x, kite_mc.dot1_mc.y); var b:Point = new Point(kite_mc.dot2_mc.x, kite_mc.dot2_mc.y); var c:Point = new
[code].....
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.
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]...
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]...
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.
I have wrote a function like ,
private function addSelectedFunc():void
{
/**
[code].....
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();.
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]...
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.
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.
I am trying to create a mindmap where the user can drag points about the screen. I have gotten as far as drawing the line via actionscript, and drag+drop the points (defined as movie clips on stage). This is the existing script - I don't know how to get the lines to follow the points. Something to do with ENTER_FRAME or updateAfterEvent?
var line:MovieClip = new MovieClip();
line.graphics.lineStyle(1,1);
line.graphics.moveTo(ptOne.x,ptOne.y);
[code]....
I'm getting 4 errors in my preloader script.Ive created a bar with bytes loaded and bytes total and a percentage.No text comes up in the dynamic fields and the bar does not progress. But when I test the movie with "simulate download" it seems that some preloading happens but I don't think its working at all really.
1120: Access of undefined property loaderinfo.
var toLoad:Number = loaderinfo.bytesTotal;
1120: Access of undefined property loaderinfo.
var loaded:Number = loaderinfo.bytesLoaded;
[code]....
Below is Entire script - on frame 1 of my timeline - the timeline is a total of 390 frames:
stop();
addEventListener(Event,ENTER_FRAME,loaderF);
function loaderF(e:Event):void{
[code]....
I bought flash to create animations. So far they play fine as a swf, but when I export as a .mov file it leaves traces of tweened symbols and looks really ugly!See my test example below, error is about 4 secs in on car and sun. Please tell me what am I doing wrong? I know it works for other people!
View 2 RepliesI created a class based on a great tutorial. It works and all that. Then I learned from another tutorial and that works great. The problem is that I'm trying to fuse them together and am just under the comprehension level for this. Could someone take a look and help me out, preferably explaining why I keep getting this error? I'll try and be as clear as possible about my needs and I'll show the code:
Needs: I want to create a button using AS3 that goes into a folder and grabs an image. I want to be able to use this over and over again so I can have, for example, three buttons that are different sizes with different images in them on the stage at the same time. I created (or learned to create) this class called Image in order to do so.
[Code]...
i am using the menu sample for some project. I have tried to add more e.g. menu 4 without the drop down, however, i am facing a lot errors with AS when i add it
View 2 RepliesIve been working on a pong game, and its coming alond well, but i have a problem with that if your score is 5, or the AI's score 5, it goes to the 'you lose/win' screen.Well, ive been working with this:
if(bluesco==5) {
gotoAndStop(6);
}
bluesco is the enemys score
6 is the lose frame
Ive tried everything i can, ive added _root.'s, changed the equals (to things like '=', '==', '>=4'), and tried things like 'nextFrame' instead of '(6)', ive changed the instances thousands of times, and if it helps:
score = 0;
bluesco = 0;
Ive also put the top code on frames, movieclips, even buttons, but i either get these errors: Nothing happens when the score gets to 5.It goes to frame 6 as soon as the frame is loaded
When using flash remoting with amfphp, what can I write in php that will trigger the 'status' method that I set up in my Responder in Flash? Or more generally, how can I determine if the service call has failed? The ideal solution for me would be to throw some exception in php serverside, and catch that exception in flash clientside... How do other people handle server errors with flash remoting?
[Code]...
I downloaded the Air 2.5 SDK and get the following Errors: 1-Design mode could not load aircore.swc. It may be incompatible with this SDK, or invalid.
2-Design mode could not load applicationupdater_ui.swc. It may be incompatible with this SDK, or invalid.
3-Design mode could not load applicationupdater.swc. It may be incompatible with this SDK, or invalid.
I installed by copy pasting the new SDK into a copy of the 4.0 SDK. I'm using FlashBuilder4. FYI: Also installed is FlashCS4 with the SWC extension.
Code:
package {
import flash.display.Sprite;
import org.papervision3d.cameras.Camera3D;
[Code].....
I've imported the correct folder in my Edit->Prefences->ActionScript 3.0 settings. I've instantiated an object and it compiles, and I'm not getting any errors but, nothing shows up on the screen.
I have made an xml video viewer which works great, however I am getting output errors when I run it- [code]...
View 1 RepliesIs it possible to log any and all errors in Flash? The debug player definitely has access to the information when a bug is encounted, is there a way to get that info and send it off in the background?
View 7 RepliesI have a MC export as Hero which I recently changed to Racer, no problems so far, then I created my own Racer.as and once I added the sourcepath to reach that class, and hence using my own constructor instead of the default one, now I get 2 errors which doesn`t make any sense:
1046 Type was not found ColorTransform 1180 Call to a possibly undefined method ColorTransform
I used ColorTransform to add blinking eyes in the MovieClip but that worked perfectly before I add the sourcepath for my class.
The class is almost empty but all which is needed is there so I guess it is related to adding the sourcepath after everything else but I cannot figure out to fix this.
package
{
import flash.display.MovieClip;
public class Racer extends MovieClip
[Code].....
I'm making a typing game that focuses on developing typing speed and accuracy. In part of this game, the user has to type a given word in a certain amount of time. If the user types the whole word within the time limit, the timer stops and it results in 100% accuracy for that word. However, if the user does not type the word within the time limit, I want to compare the typed word to the given word and find out how many errors they made.
I found this to be a lot more complicated that I had expected it to be. Fore example, if a letter was accidentally skipped or an extra letter was added, it will make all following characters seem wrong, even though the user only made one mistake.
How do I go about comparing the two strings?
I have created a file in which I have a movieclip which links to AS file.
When I create the instance on timeline it throws the below error. [code]...
i'm trying to make a simple flash movie in cs4. scene 1 > click a button > gotoandplay scene 3 thats all.
[Code]...
Is there a way to retrieve the debug information for all unhandled errors and perhaps output that error to a web script (php etc)? I was looking for a listener which could listen for any error which is thrown. Otherwise how would you ever know what errors happen in the public? People need to be running the debug flash player to see errors. So assume there would be a way to record them also.
View 1 Replies