Textfield Formating Problems Action script 3

Apologies for a probably very basic question, but I am very
new to flash and working alone.
I am trying to write a script which reads text from a file
and display it in the movie. It all works fine but I can not get
the
TextFormat object to do anything at all.
function completeHandler(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
var thistext = loader.data;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.font = "Courier";
my_fmt.size = 40;
trace(thistext);
tField = new TextField();
tField.autoSize = "left";
tField.background = false;
tField.border = false;
tField.x = 10;
tField.y = 500;
tField.alpha = 50
tField.setTextFormat(my_fmt);
tField.backgroundColor = 0x23169C;
tField.textColor = 0xFF0000;
tField.text = thistext;
addChild(tField);
Most of the TextField properties work except the ALPHA, which
I really need to set for my application.
None of the TextFormat properties including font, bold etc
are being applied. What have I failed to do?
Thanks

OK got the text working with a little fiddling
package {
import flash.display.*;
import flash.text.*;
public class testas3 extends Sprite {
function testas3(){
var thistext = "Some test text";
var tField:TextField = new TextField();
tField.autoSize = "left";
tField.background = false;
tField.border = false;
tField.x = 10;
tField.y = 50;
tField.alpha = 50
tField.backgroundColor = 0x23169C;
tField.textColor = 0x000000;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.font = "Times New Roman";
my_fmt.size = 40;
//my_fmt.underline = true;
trace(thistext);
tField.text = thistext;
// tField.defaultTextFormat= my_fmt; not like this but like
next line
tField.setTextFormat(my_fmt);
addChild(tField);
Just in case anyone else is struggling with this

Similar Messages

  • Formatting problem in Scripts

    Hi,
    If i make the Fontsize into bold or increasing the size using character format , it doesnot reflect in my Printing and Printpreview also.
    What is the problem and how can i solve this problem?
    Thanks,
    Neptune.M

    HI,
    Check these
    <b>scripts</b>
    http://www.sappoint.com/abap/ssintro.pdf
    http://www.sappoint.com/abap/sscript.pdf
    http://www.sappoint.com/abap/sscript.pdf
    http://www.sappoint.com/abap/lsetssap.pdf
    http://www.sappoint.com/abap/sscrtpex1.pdf
    http://www.sap-img.com/sapscripts.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRPROG/BCSRVSCRPROG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRRDI/BCSRVSCRRDI.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCREDIT/BCSRVSCREDIT.pdf
    Regards
    Alfred

  • CS4 Action Script display problems

    I've just used Flash CS4 for the first time after using CS3 for some time.  When using the Action Script window to write code I had the strangest problem.  When writing or pasting code in the AS window the last couple of letters or characters get cut off.  I checked my preferences and they were they same as they were in CS3 (just to be sure).  Both CS3 & CS4 both have the Monaco font as the default.  I solved the problem by changing the fint to Arial.  Now the AS displays properly.
    Wondered if anyone has seen this happen and if they knew if it was a bug or something?
    I'm using CS4 with a newer MacBook Pro and sing AS2 in this project.
    Thanks so much!
    BC

    first button is called Enter and it is btn1 in the libary, i would like that to navigate to scene 2 frame 1. this was a graphics and i converted it to a button have also tried making it a movie clip it still doesn't work. the second button is Autobiogtaphy and it is btn2, i would like that to be navigated to the frame 10 and the frame is called About. I have CS4 and i realised all the stop actions worked when i saved it in CS3 and opedned it back up so since then  i have been using that format. im also using AS3 if that makes any difference.
    So i realised i haven't been much help on details hope this helps

  • Problem with action script from Schewe and Frasier book.

    I am working on a Photoshop CS3 action script to
    open raw files, do a couple of modifications
    in Camera Raw, exit camera raw and save
    the file as a jpeg.
    I think this should work, because I am working
    on an example out of "Camera raw with Adobe
    Photoshop CS3" by Schewe and Frasier which
    shows the step recorded.
    See page 344 of Schewe and Frasier.
    In figure 9-11 you see, after the open
    statement, 10 lines of details like
    "As camera raw"
    "Model:Canon 350d" etc.
    I get the file path and name line, but
    none of the other details reflecting
    actions in Camera Raw.
    The problem is that in setting up the action, none
    of the steps done in camera raw after I do the
    open get recorded.
    And it works in my old CS version !
    Out of frustration I repeated the action
    script creation in my old CS version and
    it worked fine.
    Any idea where I am screwing up ?

    Crappy format justification:
    I sometimes have a day of family
    type pictures that are in raw format
    that I want to put up on the internet
    quickly. I would like to be able to
    apply the "Auto" feature, as in general
    it seems to be pretty good for something
    quick.
    OK, it sorta works in CS, go here
    http://www.angelplace.net/photos/sample.jpg
    It sets up all of the details and gets the
    "As camera raw" but opens the .dng file
    rather than the Camera raw window.
    The point is, these important settings
    seem to be saved, which does not happen
    in CS3.

  • Maths Problem in Action Script 2.0

    Hi surfers,
    We have a problem in Action Script 2.0 to solve the maths equation given below:
    write a code in Action Script 2.0 to solve these two equation.
    Aim: To know the value of "a" in both different equations.
    1. 2a + 5 = 3a + 1
    2. 4a + 3 = 11
    Thanks in Advance.
    Pls give me ASAP, i'm struggle here.

    Hello, you are at the wrong forum. for AS 2.o questions, hop on there: http://forums.adobe.com/community/flash/flash_actionscript
    BTY, people answer when they can, not when you want...

  • Problem in script format

    hi,
    i am having problem in script , the problem is
    s.no|    descriptio                           |   UOM                      |          Qty                   |             Rate           |          AMT            |
    01     aaaaaaaaaaaaaaaaaaaaa       11.01                             17.28                     170000000               2400000
    this is fine but when the 1st column is shot other also get affected.
    s.no|    descriptio                           |   UOM                      |          Qty                   |             Rate           |          AMT            |
    01     aa       11.01                             17.28                     170000000               2400000
    and i cannot draw vertical line here .what is the solution for this.
    Edited by: jaihind on Mar 6, 2010 12:21 PM
    hi,
    problem is if the description field is long then other coloum are comming fine but if description caloumn is small then other also get affected and its comes towards left .
    Edited by: jaihind on Mar 6, 2010 12:22 PM

    Hi
    For this u can resolve by using the Formatting characters ......
    This is your layout ..
    s.no| descriptio | UOM | Qty | Rate | AMT |
    01 aaaaaaaaaaaaaaaaaaaaa 11.01 17.28 170000000 2400000
    Assume that   your field names like  
    s.no      |  description  |    UOM      |    Qty      |      Rate      |         AMT       |
    &sno&      &desc&         &UOM&       &Qty&         &rate&         &AMT&
    asseme that  length of these fields(in characters) as per your requirement will be ...
    s.no      |  description  |    UOM      |    Qty      |      Rate      |         AMT       |
    8                  15                  5                8                 10                  15
    For these use formatting characters    like   ...
                  s.no      |  description      |    UOM      |    Qty      |      Rate      |         AMT       |
    1stLine  &sno& ,,  &desc+0(15)&,,  &UOM&       &Qty&        &rate&         &AMT&
    2ndline                 &desc+15(15)&     
    &desc+0(15)&  -  it will print  first 15 characters from 0th position
    &desc+15(15)&- From 15th position it will print 15 characters ..
    Hope you resolve your issue
    Let me know if Any concerns,.......

  • Action script problem for audio player

    i have made a introduction with a  audio and controller. I am facing one problem. I will like to play as  soon as some one enter the page but it does not.
    My action script is pasted below and kindly advise me for any changes that can be done
    var soundReq:URLRequest = new URLRequest("Sonu Nigam_Alka Yagnik - Suraj Hua M.mp3");
    var sound:Sound = new Sound();
    var soundControl:SoundChannel = new SoundChannel();
    var volumeControl:SoundTransform = new SoundTransform();
    var resumeTime:Number = 0;
    sound.load(soundReq); sound.addEventListener(Event.COMPLETE, onComplete);
    up_btn.addEventListener(MouseEvent.CLICK, increaseVolume);
    down_btn.addEventListener(MouseEvent.CLICK, decreaseVolume);
    function onComplete(event:Event):void
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
    function playSound(event:MouseEvent):void
    { soundControl = sound.play(resumeTime);
    pause_btn.visible = true;
    pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
    play_btn.visible = false; play_btn.removeEventListener(MouseEvent.CLICK, playSound);
    function pauseSound(event:MouseEvent):void {
    resumeTime = soundControl.position;
    soundControl.stop();
    play_btn.visible = true;
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    pause_btn.visible = false;
    pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
    function stopSound(event:MouseEvent):void {
    soundControl.stop();
    play_btn.visible = true;
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    pause_btn.visible = false; pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
    function increaseVolume(event:MouseEvent):void {
    volumeControl.volume += .5;
    soundControl.soundTransform = volumeControl;
    function decreaseVolume(event:MouseEvent):void {
    volumeControl.volume -= .5;
    soundControl.soundTransform = volumeControl;
    pause_btn.visible = false;

    i am having big problem with the coding below with the sound. As it we enter the site, the music auto start very loud which is not good at all for the ear drums. How do i adjust that?
    www.hitenkajal.co.uk
    var soundReq:URLRequest = new URLRequest("10 Kabhi Alvida Naa Kehna_0.mp3");
    var sound:Sound = new Sound();
    var soundControl:SoundChannel = new SoundChannel();
    var volumeControl:SoundTransform = new SoundTransform();
    var resumeTime:Number = 0;
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    up_btn.addEventListener(MouseEvent.CLICK, increaseVolume);
    down_btn.addEventListener(MouseEvent.CLICK, decreaseVolume);
    function onComplete(event:Event):void
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
    function playSound(event:MouseEvent):void
    soundControl = sound.play(resumeTime);
    pause_btn.visible = true;
    pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
    play_btn.visible = false;
    play_btn.removeEventListener(MouseEvent.CLICK, playSound);
    function pauseSound(event:MouseEvent):void
    resumeTime = soundControl.position;
    soundControl.stop();
    play_btn.visible = true;
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    pause_btn.visible = false;
    pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
    function stopSound(event:MouseEvent):void
    soundControl.stop();
    play_btn.visible = true;
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    pause_btn.visible = false;
    pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
    function increaseVolume(event:MouseEvent):void
    volumeControl.volume = 1;
    soundControl.soundTransform = volumeControl;
    function decreaseVolume(event:MouseEvent):void
    volumeControl.volume = 0.1;
    soundControl.soundTransform = volumeControl;
    pause_btn.visible = false;
    playSound(null);

  • In Trying to convert my flash movie to the latest Flash format and from action script 2 to 3

    In Trying to convert my flash movie to the latest Flash format and from action script 2 to 3 I get this error message Scene 1, Layer 'Layer 3', Frame 1, Line 2, Column 7
    1119: Access of possibly undefined property showMenu through a reference with static type Class. This is the debug scrip this.loadVariables("_urls.txt") Stage.showMenu=false; stop(); I don't know how to fix this. Can any one Help. The movie loads to 99% then stops and reloads again. over and over again.

    Stage is a protected keyword in AS3 and it has no property showMenu
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage.htm l

  • Problem with action script to button

    Hello all.
    I'm having a problem with my adobe flash CS3 action script. My button cant link to the other URL. I tried to put an action script but i fail. anyone can help me? here the attachment for my flash document.

    HELLO,
                  just check       navigateToURL()

  • Problems adding  url link to buttons in action Script 3

    each time I added it link 1 to the button on file i get these error messages-  
    1046: Type was not found or was not a compile-time constant: link1.
    1180: Call to a possibly undefined method link1.
    Warning: 3594: exec is not a recognized method of the dynamic class RegExp. var r:Object = p.exec(s);  
    This is the code I am using:   import flash.net.navigateToURL; import flash.net.URLRequest;  var link_one:link1;  link_one = new link1(); stage.addChild(link_one);  link_one.addEventListener(MouseEvent.CLICK, buttonClickHandler);  function buttonClickHandler(event:MouseEvent):void { var url:String = "http://www.masterpiececorp.com/ARMREF.htm"; var request:URLRequest = new URLRequest(url); navigateToURL(request); }    I have no other problems with link 3 or 4, just link 1  I still cannot get my urls link to movie clips on the flash  
    Can you upload flash here? if not I have a image capture I can use to have you look at my buttons  and action script code. i have been to every forum I know and not any have been helpful at all. This is my last hope.
    Very frustrated newbie  Gina T
    Message was edited by: gtaylor0406

    The way you had your code originally would be correct...
    var link_one:link1;
    link_one = new link1();
    addChild(link_one);
    The 1046 error is indicating it doesn't recognize the link1 class.  So the first thing you need to make sure of is that you have assigned the link1 class designation to whatever symbol that is in the library.

  • Action script with reference to root causing problems in Captivate

    Hi All,
    I just inserted an animation into Captivate and it seems to
    be working as intended; however, i receive a warning stating that
    action script referencing "root" may cause the Captivate project
    not to work properly or at all.
    Has anyone experienced such a problems coming from action
    script reference. It appears to be working fine, so I'd rather not
    touch it if I can get away with it.

    If you run into issues there is a technote on Adobe.com that
    will advise you
    on how to remove or work around using _root references.
    Ideally you would
    never refer to _root at all.
    Steve
    http://twitter.com/Stevehoward999
    Adobe Community Expert: eLearning, Mobile and Devices
    European eLearning Summit - EeLS
    Adobe-sponsored eLearning conference.
    http://www.elearningsummit.eu

  • Scroll panel action script problem

    Hi, I have the following action script:
    and its giving me the following errors:
    Location: Scene 1, Layer 'action', Frame 1, Line 11
    Description: 1120: Access of undefined prperty _xmouse,
    Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
    <b.yMin || _ymouse>b.yMax) {
    Location: Scene 1, Layer 'action', Frame 1, Line 11
    Description: 1120: Access of undefined prperty _xmouse,
    Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
    <b.yMin || _ymouse>b.yMax) {
    Location: Scene 1, Layer 'action', Frame 1, Line 11
    Description: 1120: Access of undefined prperty _ymouse,
    Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
    <b.yMin || _ymouse>b.yMax) {
    Location: Scene 1, Layer 'action', Frame 1, Line 11
    Description: 1120: Access of undefined prperty _ymouse,
    Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
    <b.yMin || _ymouse>b.yMax) {
    Location: Scene 1, Layer 'action', Frame 1, Line 24
    Description: 1120: Access of undefined prperty _xmouse,
    Source: var xdist = _xmouse - 185;
    Location: Scene 1, Layer 'action', Frame 1, Line 8
    Description: 1120: Access of undefined prperty _root,
    Source: var b = stroke.getBounds(_root);
    Location: Scene 1, Layer 'action', Frame 1, Line 11
    Description: 1120: Access of undefined prperty _ymouse,
    Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
    <b.yMin || _ymouse>b.yMax) {
    HERE IS MY ACTION SCRIPT
    HERE IS MY FILE
    flash5.fla
    I used the following tutorial
    http://www.gotoandlearn.com/
    Scrolling Thumbnail Panel.
    Please help as to what I should do to fix it please.

    I can't be certain, because I don't have Flash CS3 on my
    computer, but it reads as though your publish settings are set to
    the wrong version of Actionscript. The code you have attached is
    Actionscript 2, and those errors sound like something that would be
    spit out if you are trying to publish to Actionscript 3. Check your
    publish settings, and change to AS2. If you are already on AS2,
    reply, and will look into further.
    Hope this helps.

  • Action Script problem with scrolling images

    doing a tutorial and got to the stage of action scripting mouse control for scrolling images.
    checked the script in Actions. And said it was ok...No errors found.
    Tested the movie and there were 2 compiler errors reported.
    Scene 1. layer 'action script', Frame 1, line 1: 1120:Access of undefined property _root. _root.onEnterFrame=funtion(){
    Scene 1. layer 'action script', Frame 1, line 2: 1120:Access of undefined property _root. _if(_root._xmouse<50){
    Scene 1. layer 'action script', Frame 1, line 1: Warning: 1058: Migration issue: The property _root.onEnterFrame=funtion(){
    Can anyone help me understand this.
    thanks

    It sounds like you are mixing up AS2 code with AS3 compiling.  You may need to change you publish settings to AS2.

  • Problem with action script calculations

    I have a simple action script 3 code that will not calculate the correct answer on my PC.  I'm running flash cs5 on Window 7 OS.  I can move the file to another machine running  flash cs4 and it works, but when I run it on my laptop, I get funky answers.  see cold below.  I have uninstalled and reinstalled cs5 , run the cleanscript for cs5 and cs4 to make sure everything was removed.  I have uninstalled and reinstalled flash player.  but nothing seems to work.  Any help will be appreciated.  It acts like Action Script 3 is corrupt or something else that related to Action Script 3.  Everything else seems to work.  I also have a preloader running with the same issue.  It is should be showing the percentage completed but it go 2 5 50 4 32 or something funky like that.  Please help.
    the code I'm using.
    function calculateTotal(evtObject:MouseEvent):void {
       var price:Number;
       var totalCost:Number;
       var numberOfJerseys:Number;
       if (jerseyType.text == "2") {
        price = 12;
          if (jerseyType.text == "1") {
        price = 10;
       if (playerNames.text == "Y" || playerNames.text == "y") {
        price += 1.50;
       numberOfJerseys = int(numberOfPlayers.text) +int(numberOfCoaches.text);
       totalCost = numberOfJerseys*price;
       total.text = String(totalCost);
    calc_btn.addEventListener(MouseEvent.CLICK, calculateTotal);     
    the preloader percentage is
    var percent:int = amtLoaded*100
    percent_txt.text = String(percent);

    HELLO,
                  just check       navigateToURL()

  • Problem With Action Script

    function loadProgress(my_content:ProgressEvent):void {
              var percent:Number = Math.floor( (my_content.bytesLoaded * 100) / my_content.bytesTotal );
              percent_Txt.text = percent + "%";
              preloader.gotoAndStop(percent);
    function loadComplete(e:Event):void {currentFrame;}
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
    loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
    is not working
    Mean
    the Text is to 1 - 100 % increase.
    But not working that .
    Only others are animating
    Please some one help me

    function loadProgress(my_content:ProgressEvent):void {
              var percent:Number = Math.floor( (my_content.bytesLoaded * 100) /
    my_content.bytesTotal );
              percent_Txt.text = percent + "%";
            preloader.gotoAndStop(percent);  // preloader should have frames
    1,...,100.*
    function loadComplete(e:Event):void {
    currentFrame+1;
    // the above will do nothing.  what are you trying to do?
    This action script is not working in my background. Any settings to change.?

Maybe you are looking for

  • Is there a calendar which can be shared by multiple IPads in the same business?

    Is there a recommended calendar which can be used by multiple employees on their respective IPADS when we go offsite to set up in house appointments?We want to use one central calendar, so we don't overlap times and dates in the same office? Please h

  • How to call BSP page in one frame from a webdynpro page in another frame?

    Dear experts, I have a scenario as follows: A BSP application which contains 5 frames. in the first frame I am calling a web Dynpro application. This is a tree and it is displayed correctly. on click of an item (node item) in the tree, a bsp page sho

  • Beautiful 3G no phone service

    Hello everyone, I just did the 2.1 software Update and yes, it seems to work faster with the contacts and even on the web, but if the 3G is ON I can't recieve or make any phone calls... I don't know if this matters but I'm in Mexico... Anyone with th

  • WorkStation 11 shared VM's suddenly get a red X and "unable to read configuration data"

    This will usually follow a re-boot of the host machine, running Windows Server 2012. I can then REMOVE the machine(s) And open the .vmx file from the file manager ... After which I can again share the file. What can I do to prevent this?  Has anyone

  • Hierarachy display in report

    Hi All, How do I display the hierarchy in my report in expanded manner by default? when I execute my query the report comes with the higher node. I manually expand the hierarchy by right clicking on it. I want to display all the nodes expanded by def