Skip to main content
barpos
Known Participant
March 20, 2011
Answered

Error: Error #2078: The name property of a Timeline-placed object cannot be modified.

  • March 20, 2011
  • 1 reply
  • 5877 views

Error: Error #2078: The name property of a Timeline-placed object cannot be modified.
    at flash.display::DisplayObject/set name()
    at RonaldTest_fla::MainTimeline/frontWheelLoadComplete()

The code that triggers that bogus error is the following:

--------------------------------------------------------------------------------------------------------------------------------------------------

var frontWheelLoader:Loader = new Loader();
frontWheelLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, frontWheelLoadComplete);
frontWheelLoader.load(new URLRequest("FrontWheel.png"));

function frontWheelLoadComplete(event:Event):void
{
    var loadedImg:Bitmap = new Bitmap();
    loadedImg = event.target.content;
    loadedImg.name = "My Loaded Image";          // bugging line
    var kontainer:MovieClip = new MovieClip();
    kontainer.addChild(loadedImg);
    addChild(kontainer);
}

--------------------------------------------------------------------------------------------------------------------------------------------------

Any ideas?

Regards,

Ron

This topic has been closed for replies.
Correct answer FeZEC

Follow-up!

I just created a new AS3 Flash document and copied and pasted the same code.  The problem remains even though the new timeline is absolutely empty.

Ron


The problem is that loader adds that information to a loaded image as an instance.

If you wish to change the name.. get the BitmapData from teh bitmap  var data:BitmapData= Bitmap(event.target.content).bitmapData

and then     var frame:Bitmap=new Bitmap(data); frame.name="name"

1 reply

Inspiring
March 20, 2011

Looks like you have an object on the timeline with name loadedImg that you defined at authoring.

barpos
barposAuthor
Known Participant
March 20, 2011

I swear to God, I don't. I have tried many different names, but to no avail ...

var loadMe:Loader = new Loader();
loadMe.contentLoaderInfo.addEventListener(Event.COMPLETE, loadIsNowcomplete);
loadMe.load(new URLRequest("Snowfighter.jpg"));

function loadIsNowcomplete(event:Event):void
{
    var abcdefghijklmnopqrstuvwxyz:Bitmap = new Bitmap();
    abcdefghijklmnopqrstuvwxyz = event.target.content;
    abcdefghijklmnopqrstuvwxyz.name = "MyLoadedImage";            // bugging line
    var kontainer:MovieClip = new MovieClip();
    kontainer.addChild(abcdefghijklmnopqrstuvwxyz);
    addChild(kontainer);
    trace("content: " + kontainer.getChildAt(0).name);  // instance8
    theTween.addTarget(abcdefghijklmnopqrstuvwxyz, 1);
}

barpos
barposAuthor
Known Participant
March 20, 2011

Follow-up!

I just created a new AS3 Flash document and copied and pasted the same code.  The problem remains even though the new timeline is absolutely empty.

Ron