Error 1069 Property 0 not found on flash.text.TextField and there is no default value
StoneChameleon Aug 19, 2011 5:49 PMSo, I've been working on this for a few days and what drives me nuts is this is a simple file with a lot of simple script and I still can't figure out what this error is and how to fix it: Property 0 not found on flash.text.TextField and there is no default value
The script below what we're looking at, everything is drawn with AS3, there are no library objects (save for the font). I sort of understand what the error is saying, but I don't fully understand it or how to fix it.
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.filters.BlurFilter;
import flash.display.Shape;
import flash.display.Sprite;
import flash.display.Graphics;
import flash.events.*;
import flash.geom.*;
import flash.events.*;
var boxBg:Shape = new Shape();
boxBg.graphics.lineStyle(1, 0x000000, .5, true);
boxBg.graphics.beginFill(0xff6600);
boxBg.graphics.drawRect(0, 0, 50, 50);
boxBg.graphics.endFill();
var box:Sprite = new Sprite();
box.x = 335;
box.y = 245;
addChild(box);
box.addChild(boxBg);
var toggleBg:Shape = new Shape();
var toggleBtn:Sprite = new Sprite();
toggleBg.graphics.lineStyle(1, 0xefefef, .5, true);
toggleBg.graphics.beginFill(0xffffff);
toggleBg.graphics.drawCircle(0, 0, 25);
toggleBg.graphics.endFill();
toggleBtn.buttonMode = true;
toggleBtn.mouseChildren = false;
toggleBtn.x = stage.stageWidth - 75;
toggleBtn.y = 25;
addChild(toggleBtn);
toggleBtn.addChild(toggleBg);
for (var i:int = 0; i < 10; i++) {
var btnBg:Shape = new Shape();
btnBg.graphics.lineStyle(1, 0xefefef, .5, true);
btnBg.graphics.beginFill(0xffffff);
btnBg.graphics.moveTo(12, 0);
btnBg.graphics.lineTo(24, 20);
btnBg.graphics.lineTo(0, 20);
btnBg.graphics.lineTo(12,0);
btnBg.graphics.endFill();
var btnFont = new Myriad();
var btnFormat:TextFormat = new TextFormat();
btnFormat.font = btnFont.fontName;
btnFormat.size = 12;
btnFormat.align = "center";
btnFormat.color = 0xffffff;
var btnTxt:TextField = new TextField();
btnTxt.defaultTextFormat = btnFormat;
btnTxt.width = 50;
btnTxt.height = 20;
btnTxt.y = 5;
var myBtn:Sprite = new Sprite();
myBtn.name = ("Blend " + (i + 1));
myBtn.buttonMode = true;
myBtn.mouseChildren = false;
addChild(myBtn);
myBtn.x = 10 + (i * 75);
myBtn.y = 500;
myBtn.addChild(btnBg);
myBtn.addChild(btnTxt);
btnTxt.text = myBtn.name;
myBtn.addEventListener(MouseEvent.CLICK, btnHandler);
myBtn.addEventListener(MouseEvent.ROLL_OVER, btnHandler);
myBtn.addEventListener(MouseEvent.ROLL_OUT, btnHandler);
toggleBtn.addEventListener(MouseEvent.MOUSE_DOWN, onToggleVisible);
}
function btnHandler(event:MouseEvent):void {
if(event.type == MouseEvent.CLICK){
if(event.currentTarget == btnTxt[0]){
box.blendMode = BlendMode.NORMAL;
}
if(event.currentTarget == btnTxt[1]){
box.blendMode = BlendMode.DARKEN;
}
if(event.currentTarget == btnTxt[2]){
box.blendMode = BlendMode.DIFFERENCE;
}
if(event.currentTarget == btnTxt[3]){
box.blendMode = BlendMode.HARDLIGHT;
}
if(event.currentTarget == btnTxt[4]){
box.blendMode = BlendMode.INVERT;
}
if(event.currentTarget == btnTxt[5]){
box.blendMode = BlendMode.LIGHTEN;
}
if(event.currentTarget == btnTxt[6]){
box.blendMode = BlendMode.MULTIPLY;
}
if(event.currentTarget == btnTxt[7]){
box.blendMode = BlendMode.OVERLAY;
}
if(event.currentTarget == btnTxt[8]){
box.blendMode = BlendMode.SCREEN;
}
if(event.currentTarget == btnTxt[9]){
box.blendMode = BlendMode.SUBTRACT;
}
}
}
function onToggleVisible(event:MouseEvent):void {
box.visible = !box.visible;
}
I've searched through similar problems, but couldn't find a proper solution. If anyone can help me pinpoint the issue and solution, I would be incredibly grateful.


