Results 1 to 6 of 6
-
June 29th, 2008, 09:15 AM #18Registered User
postsNeed help regarding adding Textfield to Flash document
-
June 29th, 2008, 09:33 AM #2
Ummmm...here you go:
http://livedocs.adobe.com/flash/9.0/...TextField.html
You're far more likely to get help if you provide specific details of what your problem is.
©2006-11 GlosRFC - Searching 8,168,684,336 brain cells
-
June 29th, 2008, 09:54 AM #324Registered User
postsdear which type of text field u want to put in flash doc.
-
June 29th, 2008, 03:21 PM #48Registered User
postsmy friend abrarshf it is dynamic text field
-
June 29th, 2008, 03:43 PM #5
Read. The. Link. : )
* [ Flash portfolio ] http://www.erikhallander.com/
* [ Flash blog ] http://www.erikhallander.com/blog/
* [ Work @ ] http://www.visualjazz.com.au
-
June 30th, 2008, 09:29 AM #68Registered User
postsHi glosrfc
please find the RunningTest.as code below and it's working fine on document class but my problem is i want to reuse the code in flash action panel with new values to instance variables and i expected output according to that. and i am expecting like this please help me to find the solution.
var txt:RunningText = new RunningText();
txt.fName= "Times New Roman";
txt.tMatter1 = "Some custom Text falls here";
addChild(txt);
================================================== ====================
The error is
================================================== ==================
---------------------------------------------------------------------------------------
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at RunningText$iinit()
at RunningText_fla::MainTimeline/RunningTextRevised_fla::frame1()
----------------------------------------------------------------------------------------
package {
import flash.display.*;
import flash.text.*;
import flash.events.*;
public class RunningText extends Sprite {
public var tField1:TextField = new TextField();
public var tField2:TextField = new TextField();
public var tFormat1:TextFormat;
public var tFormat2:TextFormat;
public var fName:String = "Arial";
public var fColor:uint = 0xCC00CC;
public var fSize:int = 20;
public var tMatter1:String = "There is no topic available. Use the Search or Table of Contents to locate the desired information.Use the Search or Table of Contents ";
public var tMatter2:String = "The String class is a data type that represents a string of characters. The String class provides methods and properties. ";
public var valueX:int = stage.stageWidth / 2;
public var valueY:int = stage.stageHeight / 2;
public var speed:int = 10;
public var endX:int = -1;
public var distX:int = 5;
public function RunningText(){
tFormat1 = new TextFormat(fName,fSize,fColor);
tField1.multiline = false;
tField1.autoSize = TextFieldAutoSize.LEFT;
tField1.defaultTextFormat = tFormat1;
tField1.text = tMatter1;
addChild(tField1);
tField1.x = valueX;
tField1.y = valueY;
tField2.multiline = false;
tField2.autoSize = TextFieldAutoSize.LEFT;
tField2.defaultTextFormat = tFormat1;
tField2.text = tMatter2;
addChild(tField2);
tField2.x = valueX + tField1.width + 2 ;
tField2.y = valueY;
addEventListener(Event.ENTER_FRAME,eFrame);
}
function eFrame(e:Event){
tField1.x -= speed;
tField2.x -= speed;
var bound1 = tField1.getBounds(root);
var bound2 = tField2.getBounds(root);
if (bound1.right <= endX) {
tField1.x = bound2.right + distX;
}
if (bound2.right <= endX) {
tField2.x = bound1.right + distX;
}
}
}
}

Reply With Quote

Bookmarks