Error 1151: A conflict exists with definition event in namespace internal.
Here is the code that is creating an error:
var event:ListEvent = new ListEvent("change"); listGrid.dispatchEvent(event);
Nothing looks wrong right? Take a look at the function it is in.
private function xmlReturned(event:ResultEvent) : void { //... var event:Event = new Event("change"); listGrid.dispatchEvent(event); }
Now do you see the problem? I am redeclaring the “event” variable. It already exists in this scope. It is legal to redeclare a local variable in the same scope in AS3 but only if the variable is of the same type. If I declared the “event” variable as type “ResultEvent” then this code would work. Changing the variable name to a different name such as “changeEvent” cleared up the problem.
This also appeared when I had two variables named the same but again, they were different types.
// declared in a script tag [Bindable] [Embed(source='images/preloader1.png')] public var image1:Class;
// later declared in an image
Read more about this error at Compiler Errors
Please post in the comments if this has helped you or not
Well I don’t think you really posted this article on “December 31st, 1969 at 4:00 pm” – however, it feels like I’ve been chasing this silly bug down that long. Thank you so much for posting! Now I can go home 🙂
LikeLike
this error also seems to occur when you’re trying to declare a variable in a document class, when you already have a movieclip of the same name on the stage of the corresponding swf.
LikeLike
Thanks Judah!!!!!
I am stater to flux.Reading ur Blog had really helped in sorting out my problem
LikeLike
OK, been trying to implement this code for a few hours now. And got it sort of working.
But I’m implementing it in another class and therefore cannot (will not) acces things like the stage width etc. Not a problem, yet, just placing it direct. But I’m having a conflict with internal definition of TextField.
1151: A conflict exists with definition progress_txt in namespace internal.
I’ve pasted all assets into my own Flash-file and referencing your classes. But it seems that it clashes with my own class in which it is implemented. It all works in terms of upload and all, it just never show the progress. And that’s only when I comment out the lines:
26: public var progress_txt:TextField;
27: public var progress_bar:ProgressBar;
28:public var bg_mc:MovieClip;
in FileUploader.as, otherwise it won’t compile, giving me the error above.
Now, would you have any idea how to implement it in other classes and not just flat on the timeline/stage?
LikeLike
@Sven – Hi Sven. The internal namespace might already be using that name. I would change the names of the variable(s). For example, “progress_txt” to “progress_txt1” and see what happens.
LikeLike
Hi Judah,
Just tried that without any change. But I read this post about the problem:
http://www.kirupa.com/forum/showthread.php?t=271641
Just don’t know how to use it in my case. Just thought it made sence since the code was originally on a timeline. But is now copied into a class … hmm.
LikeLike
Hmm… I’m not as familiar with Flash AS3 as Flex AS3. I think maybe the public keyword might be causing the issue? If not I’m not sure, maybe code on another frame might be declaring a variable with the same name twice.
LikeLike
Already tried that one, but maybe this is not the problem at all. The preloader simply do not show up.
I’ve simply removed the three lines from the script, and my problem is gone. But I now have to struggle to get the damn thing to show itself.
Hmm, probably gonna spend the whole week with this. 😦
But thanks a lot for trying to help out. 🙂
LikeLike
For others who may have the same problem of moving this into their own classes.
I had the thing placed within a movieclip in the lower right corner of the main movie. Therefore the thing was ‘out of sight’. And the fact that textfields etc were already in the timeline, simply remove the recreation from the class and you should be fine.
So hierarchy and redundancy would be where to look for errors.
LikeLike
Just what I was looking for.
Thanks!
LikeLike
YOU ARE THE MAN!
LikeLike
Thanks alot , i found solution much faster….
LikeLike
Hi everyone,
I am trying to intergate ‘flashmo_112_news_tab’ or ‘flashmo_178_photo_tab’ with other free template from flashmo.com. They say “it is easy to integrate”… actually sounds even funny after a month of endless efforts to integrate it.
I have tried everything. I was inserting a new symbol and importing swf to the stage. Shows nothing. When I copy all the layers and paste it to the template, I got compiler errors like the error no. 1151 discussed above.
I have also copied all the necessary files (xml, thumbnails, photos, caurina transitions) from photo tab template folder to my main free template folder and still nothing. I just do not understand what is needed to make that tabs working in other flash templates.
Is there any way of integrating this photo tab with other free template? I will be very grateful for a detailed advice or at least some clue.
Thanks a lot.
LikeLike
I’m having problems with this. I’m trying to copy an event change and I’ve really tried to give them unique names but for some reason I’ve messed things up. Here’s my code:
What I’m trying to do is have three boxes on each row in my document. The user can click multiple ones on each row and it sends the data to a textArea. It worked before but stopped working when I added other types of boxes and code further down.
The problems are around row 250 and start with the row
for (var i:int=0; i<sportsCheckBoxessys02.length; i++)
For some reasons I don't get any error with the row above, but all below have problems. I've checked for curly brackets and that shouldn't be it, but I don't really know. I'm just playing around trying to learn how to use multiple checkboxes. I have had problems with syntax error due to curly brackets, but once they are fixed new problems appear. I do get errors like "5000: The class 'fl.controls.TextArea' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type" now but maybe that will solve itself once the conflicting names are fixed.
Can anyone have a look at the code? I could really need a hand with this. I'm just doing this for a hobby and these checkboxes did work before, until I added more code for other types of buttons. These buttons that are conflicting are complaining about having name conflicts but they never complained before and I didn't change them, I just added more code. Is there a curly bracket problem somewhere perhaps?
If I ever solve this with help from someone I'll try to compare the output data from each row with that of a "parent column", but it's made up of 1 X 2, is that possible? I'm trying to build something like a sheet where I can correct my results from a series of 13 game outcomes (1, x, 2).
Kind regards
LikeLike
Hi checkboxmaniac – You’ll want to post your question to the flashcoders mailing list or stack exchange.
LikeLike
just change the class name that have error and also change the class name every where called its name, good luck
LikeLike