05.06.08

Flex / Flash Error #1151

Posted in Error, Error, Flash, Flex, errors at 8:44 pm by Curtis J. Morley

ActionScript Error #1151: A conflict exists with definition progBar in namespace internal.

ActionScript 3 Error #1151
Description:
AS3 error 1151 is an easy one. This means that within your ActionScript class(namespace internal) there is already a variable or function by that name.

Fix:
To solve Flex/Flash Error 11151 just hit CTRL-F(Apple-F) and search for that term that has a conflict and change it to something appropriate. You may have been building a particle system or working with an X or Y variable and forgot to change one of them so that they both read exactly the same. The example below shows what I mean and how to solve the issue.

Bad Code 1:

public class Particle extends Sprite
{
public var xVelocity:Number;
public var xVelocity:Number;

Good Code 1:

public class Particle extends Sprite
{
public var xVelocity:Number;
public var yVelocity:Number;

This should help you resolve Flash / Flex Error #1151

Thanks and as always Happy Flashing

Curtis J. Morley

Related Error(s) : ActionScript Error #1024 , ActionScript Error #1056

3 Comments »

  1. curtismorley.com » ActionScript ReferenceError: Error #1056 said,

    July 16, 2008 at 10:00 am

    [...] s._x = 10; will give error 1119 but var s = new Sprite(); s._x = 10; will give Error 1056. Flash / Flex Error 1151 Flash / Flex Error 1069 - This is the error you will get if you try and call a method with a [...]

  2. Corsiaan said,

    August 22, 2008 at 3:34 pm

    What you state is true for people coding AS3 on the timeline. People however who use an application class or mc class to declare their clips on stage, eg:


    package examples
    {
    import flash.display.MovieClip;

    public class MyApplication extends MovieClip
    {
    public var myClip:MovieClip; // clip on stage, instancename 'myClip'
    ... etc

    …just need to find the checkbox ‘Automatically declare stage instances’ (Publish setting -> AS3 settings) and tick it off.

    This (as the checkbox states, duh) prohibits Flash from declaring instances, so you can declare them yourselfs in the class and get a nice reference and code completion and stuff..

  3. stefani said,

    August 22, 2008 at 4:05 pm

    i have a flash file with a layer holding more than 1 keyframe. each keyframe has an input txt field w/UIScroll bar attached. i’m loading a different external txt doc into each txt box. in the actions layer, on the same frame # of the 1st txt box, i have the actionscript 3.0:

    var url:String = “glossary.txt”;
    var loadglossary:URLLoader = new URLLoader();
    loadglossary.addEventListener(Event.COMPLETE, completeHandlerGlossary);
    loadglossary.load(new URLRequest(url));

    function completeHandlerGlossary(event:Event):void {
    glossaryField.text = event.target.data as String;
    }

    the external file is loaded into the txt box w/o issue.

    in the actions layer, on the same frame # of the 2st txt box, i have the actionscript 3.0:

    var url:String = “systemReq.txt”;
    var loadsysreq:URLLoader = new URLLoader();
    loadsysreq.addEventListener(Event.COMPLETE, completeHandlerSystemReq);
    loadsysreq.load(new URLRequest(url));

    function completeHandlerSystemReq(event:Event):void {
    systemReqField.text = event.target.data as String;
    }

    but here i get (my guess is refering to the 1st line of as):

    1151: A conflict exists with definition url in namespace internal.

Leave a Comment