Scroll event: movieclip instead of dynamic text

Hello everyone. I am very very new to actionscript, so probably my question sounds a bit ridiculous.

I'm putting an Arabic text to scroll with a custom scroll bar. So I found a nice video in youtube , all this with a dynamic text field. It works wonderful for Latin characters (from left to right and separated from the letters) but unfortunately not for Arabic characters (they don't connect). In fact, I do not use just a movieclip with the text instead of the dynamic text field. But I don't know how to change the actionscript code for the video instead of the dynamic text field.

Here I show you the code for the scrolling text in a dynamic text field (it's a small code), on the stage, I got just the dynamic text field (instance name: texto_txt), the scroll bar (a vertical line, the name of the instance: scrollBar_mc) and the scrolling itself (a small rectangle, the instance name (:scrollHandle_mc):

var content: String = "cjeihfirehjfejlkfjkerjfirjfejifjrijwkjfirwjeknlkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkllllllll";

texto_txt. Text = content;
texto_txt.WordWrap = true;

var min: number = scrollHandle_mc.y;

var max: number = min +(scrollBar_mc.height-scrollHandle_mc.height);

var range: number = max - min;

var arrastrando: Boolean = false;

the var limits: Rectangle = new Rectangle (scrollHandle_mc.x, scrollHandle_mc.y, 0, scrollBar_mc.height - scrollHandle_mc.height);

scrollHandle_mc.addEventListener (MouseEvent.MOUSE_DOWN, arrastrandoScroll);

stage.addEventListener (MouseEvent.MOUSE_UP, stopIt);

function arrastrandoScroll(mouseEvent:MouseEvent)

{

scrollHandle_mc.startDrag (false, bounds);

arrastrando = true;

scrollHandle_mc.addEventListener (Event.ENTER_FRAME, progress);

}

function stopIt(mouseEvent:MouseEvent)

{

scrollHandle_mc.stopDrag ();

arrastrando = false;

}

function progress(e:Event)

{

var moverScroll:Number = scrollHandle_mc.y - min;

var p: Number = moverScroll/range;

If (arrastrando is true)

{

texto_txt.scrollV = % * texto_txt.maxScrollV;

}

}

What I want to do is clear the dynamic text field and use rather a movieclip (text_mc) which already includes the text, the bounding box would be a mask. How can I change the actionscript code? Could someone help me?

It isn't really a question of mathematics, as it is a logical reasoning, but if you plan to do things with the lineup, you expect better familiarize themselves with the learning of mathematics as well.  Programming and math go hand in hand.

This is a simplified explanation of what your code should-> if you move the wheel of 25% of the total distance, it can move, then the movieclip should be moved 25% of the distance, he can move (in the sense of oppostie).

Your scroll handle can be moved from a predefined distance.  In your code, this is called the "range".  See if you can understand how this value is determined in 3 lines of code.

var min: number = scrollHandle_mc.y;

var max: number = min +(scrollBar_mc.height-scrollHandle_mc.height);

var range: number = max - min;

Later depending on your progress, you can see where the handle of the scrollbar values com into play again to determine where to place the textfield object.  But if we change that to be the movieclip, it becomes more similar to the following...

function progress(e:Event)

{

var moverScroll:Number = scrollHandle_mc.y - min;

var p: Number = moverScroll/range;

If (arrastrando is true)

{

yourMC.y = % * (yourMCmaxY-yourMCminY) + yourMCMinY;

where yourMCmaxY-yourMCminY's range of movement of the mc

who is likely to be negative since yMax is likely< ymin="" for="" the="">

  }

}

Tags: Adobe Animate

Similar Questions

  • Help with dynamic text and cursor hand

    The buttons I create do not display the hand cursor. I tried searching for an answer and found nothing. These are buttons in movieclip with a dynamic text field. I already passed the unselectable text, and I use: b1.buttonMode = true;




    B1.mouseChildren = false;

  • Dynamic text and Movieclip appear on turnover of button

    Hi guys,.

    I have a question - when one of my buttons is overthrown, I want text and a movieclip to appear. When the button is wrapped is no longer on, I want the text and the movieclip to disappear.

    The way that I was going to do was to have anchor_mc as an anchor and turnover have the movieclip play from inside the anchor (as his exact x & Y that his need to) and dynamic text appear.

    Issues related to the:

    (1) How can I join mc_textbox to mc_anchor - OR, how set coordinates for just where mc_textbox should show?

    (2) I how then do the movieclip disappear if the button is reversed is no longer?

    (3) is it not possible for me to all the functions of dynamic merge into one function, text by using IF statements? I tried, but could not get out.

    AS3 code is attached below.

    import flash.events.MouseEvent;

    Stop();

    LINE1.addEventListener (MouseEvent.ROLL_OVER, line_in1, false, 0, true);
    LINE1.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);
    Line2.addEventListener (MouseEvent.ROLL_OVER, line_in2, false, 0, true);
    Line2.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line3.addEventListener (MouseEvent.ROLL_OVER, line_in3, false, 0, true);
    line3.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);
    LINE4.addEventListener (MouseEvent.ROLL_OVER, line_in4, false, 0, true);
    LINE4.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line5.addEventListener (MouseEvent.ROLL_OVER, line_in5, false, 0, true);
    line5.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);
    Line6.addEventListener (MouseEvent.ROLL_OVER, line_in6, false, 0, true);
    Line6.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line7.addEventListener (MouseEvent.ROLL_OVER, line_in7, false, 0, true);
    line7.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line8.addEventListener (MouseEvent.ROLL_OVER, line_in8, false, 0, true);
    line8.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);
    LINE9.addEventListener (MouseEvent.ROLL_OVER, line_in9, false, 0, true);
    LINE9.addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);

    function line_in1(e:MouseEvent):void
    {
    line_output. Text = "this is a test made by the MonkeyTest who previously messed up\n and test a new line;
    }
    function line_in2(e:MouseEvent):void
    {
    line_output. Text = "until sali has previously MonkeyTest the test done one is - this";
    }
    function line_in3(e:MouseEvent):void
    {
    line_output. Text = "this is a test made by the MonkeyTest who previously messed up\n and test a new line;

    }
    function line_in4(e:MouseEvent):void
    {
    line_output. Text = "until sali has previously MonkeyTest the test done one is - this";
    }
    function line_in5(e:MouseEvent):void
    {
    line_output. Text = "this is a test made by the MonkeyTest who previously messed up\n and test a new line;

    }
    function line_in6(e:MouseEvent):void
    {
    line_output. Text = "until sali has previously MonkeyTest the test done one is - this";
    }
    function line_in7(e:MouseEvent):void
    {
    line_output. Text = "this is a test made by the MonkeyTest who previously messed up\n and test a new line;

    }
    function line_in8(e:MouseEvent):void
    {
    line_output. Text = "until sali has previously MonkeyTest the test done one is - this";
    }
    function line_in9(e:MouseEvent):void
    {
    line_output. Text = "until sali has previously MonkeyTest the test done one is - this";
    }

    function line_out(e:MouseEvent):void
    {
    line_output. Text = "";
    var MC = new mc_empty(); addChild (mc);
    }

    It isn't relly clear for me what you have from what you want, so these answers can be as not clear to you.

    1. a way to join them together is instead of the one maually in the other file.  Another way is to use addChild to add the text mc at anchor... mc_anchor.addChild (mc_textbox);  To control where the mc of text is displayed you can set its x and y actionscript properties.using... mc_textbox.x = 0;

    2. make the movieclip disappear you can set its visible property to false... mc_anchor.visible = false;

    3. you can probably reduce code considerably, although it depends in part on what changes there really going to be in the text that is displayed for each bearing.  For now, I'll assume that the text will be completely different for each...

    for (var i: uint = 1; i<10;>

    this ["Line" + String (i)] .addEventListener (MouseEvent.ROLL_OVER, line_in, false, 0, true);
    This ["Line" + String (i)] .addEventListener (MouseEvent.ROLL_OUT, line_out, false, 0, true);

    }

    function line_in(e:MouseEvent):void {}

    var lineTarget:MovieClip = MovieClip(e:currentTarget);

    could use a switch the series if if you know what is a switch

    if(lineTarget == LINE1) {}

    do things for line1

    } else if(lineTarget == line2) {}

    do things for line2

    ) otherwise if... etc.

    }

  • Determine is scrolling is required on dynamic text? (AS2)

    Hey everybody,

    I have a few pages of text based on a site that I am trying to build, that contain dynamic text (content in a database, which can be changed by the way). These are loaded into a dynamic fixed size text box that is part of my page. It all works very well. I created two movieclips of scrolling (which act like buttons, one for upward, for down) which, once clicked causes the text box to scroll upwards or downwards as relevant. They work very well as well.

    The problem I have is I want only the scroll buttons to appear if necessary (i.e. If the text in the text field is greater than its height, you need to scroll to read all about it), but I can't work on how to find the height of the actual content (as opposed to the predefined dynamic text box). I can of course create as automatically resized text box, and then find it of height, then compare it to the desired height and (if greater) manually change its height and display the scrolling of the buttons, however I can't imagine is the most effective way to do it at all?

    I'm sure that there is a standard, logical way to do it, but I can't find a reference to it online or in the forums, but perhaps because I'm looking for the wrong thing?

    Thank you very much for your help in advance everybody, it's really appreciated,

    Dave

    Search the help files for the TextField class. You will see all of the properties of the class. I think you'll find that MaxScroll will tell you if all of the text fits or not.

  • Adding buttons and the scroll to dynamic text bar

    Hello

    I'm trying to connect a dynamic text to the scroll bar and buttons. I did the tutorial and Lynda.com and practically pasted the code with my names of files and for some reason it does not work. He said I "access of undefined property mask_mc" did I need to create a variable for that? I have not in the tutorial.

    Right now I have the dynamic text to load successfully in 2 different places and I wantd to add the scroll bar. I put the variables on the code in frame 1 and then I put the loading code on the frame where it is needed.

    Any suggestions?

    Thank you! Sandra

    HERE'S THE CODE FOR FRAME 1:


    var textLoader:URLLoader = new URLLoader();
    var textReq:URLRequest;


    var scrollPercent:Number = 0;
    var minScroll:Number;
    var maxScroll:Number;
    var targetScroll:Number = philText_mc.y;
    relaxation of the var: number = 5;
    var scrollAmt:Number = 15;
    var scrollDirection:Number = 0;

    HERE'S THE CODE FOR WHICH TEXT SUPPORT:

    textReq = new URLRequest ("text_philosophy.txt");


    function philosophyTextLoaded(event:Event):void {}
    philText_mc.philosophy_txt.text = textLoader.data;
    minScroll = philText_mc.y;
    maxScroll = minScroll - philText_mc.height + mask_mc.height;
    }

    function dragScroller(event:MouseEvent):void
    {
    var dragX:Number = line_mc.x - scroller_mc.width/2 + 1;
    var dragY:Number = line_mc.y;
    var dragW:Number = 0;
    var dragH:Number = line_mc.height - scroller_mc.height;

    scroller_mc.StartDrag (false, new Rectangle (dragX, dragY, dragW, dragH));
    stage.addEventListener (MouseEvent.MOUSE_UP, stopDragging);
    stage.addEventListener (Event.ENTER_FRAME, setScrollPercent);
    stage.removeEventListener (Event.ENTER_FRAME, scrolling).
    }

    function stopDragging(event:MouseEvent):void
    {
    scroller_mc.stopDrag ();

    }

    function setScrollPercent(event:Event):void
    {
    scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
    If (scrollPercent < 0)
    {
    scrollPercent = 0;
    }
    ElseIf (scrollPercent > 1)
    {
    scrollPercent = 1;
    }
    targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
    philText_mc.y = (philText_mc.y - targetScroll) / acceleration;
    }

    function scrollUp(event:MouseEvent):void
    {
    setDirection (scrollAmt);
    }

    function scrollDown(event:MouseEvent):void
    {
    setDirection(-scrollAmt);
    }

    function setDirection(dir:Number):void
    {
    scrollDirection = dir;
    stage.addEventListener (Event.ENTER_FRAME, scrolling).
    stage.addEventListener (MouseEvent.MOUSE_UP, stopScrolling);
    stage.removeEventListener (Event.ENTER_FRAME, setScrollPercent);
    }

    function scrollText(event:Event):void
    {
    targetScroll += scrollDirection;
    philText_mc.y = (philText_mc.y - targetScroll) / acceleration;
    if(philText_mc.y > minScroll)
    {
    philText_mc.y = minScroll;
    targetScroll = minScroll;
    }
    of other if(philText_mc.y < maxScroll)
    {
    philText_mc.y = maxScroll;
    targetScroll = maxScroll;
    }
    scrollPercent = (philText_mc.y - minScroll) / (maxScroll - minScroll);
    scroller_mc.y = (scrollPercent * (line_mc.height - scroller_mc.height)) + line_mc.y;
    }

    function stopScrolling(event:MouseEvent):void
    {
    scrollDirection = 0;
    }

    textLoader.load (textReq);
    scroller_mc.buttonMode = true;
    philText_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
    scroller_mc.addEventListener (MouseEvent.MOUSE_DOWN, dragScroller);
    textLoader.addEventListener (Event.COMPLETE, philosophyTextLoaded);
    up_btn.addEventListener (MouseEvent.MOUSE_DOWN, scrollUp);
    down_btn.addEventListener (MouseEvent.MOUSE_DOWN, drop);

    I don't know if I already talked to you or not Sarah... I've made for one person recently however... I do not consider myself to be an expert with this stuff, and I gain no rewards for my outlook on the approach of a design solution. I say, if it works, use it.  If you can think of another way to help you on a Knoll, continue it... Doing this reaches you to achieve the solution that you need for the approach that you have filed.  Everything what you end up doing, you learn new things...  With Flash you really learn only by try, fail, rinse and repeat... (my opinion/experience)

  • creation of an area of dynamic text inside a movieclip using a loop for

    I'm having issues creating several areas of dynamic text inside a movieclip using a loop for.  I use 2 ACEs.  Here is the code I've created so far

    var leading: Number = 0;

    function drawClip (): Void

    {

    this.createEmptyMovieClip ("mc", 10);

    for (i = 0; i < 5; i ++)

    {

    mc.createTextField ('text areas' + i, this.getNextHighestDepth (), 0, leading, 200, 200)

    MC ["text boxes" + i] .text = i;

    leader + a = 20;

    }

    }

    drawClip();

    Create a mc but she only display the number 5

    Any thoughts?

    You are cionstantly, crushing the textfield created previously due to the use of the wrong depth define.  You point to 'this' to get a depth value, but he planted inside 'mc', so it's always at the same depth since "this" index of depth does not change.  Use...

    mc.createTextField ('text areas' + i, mc.getNextHighestDepth (), 0, leading, 200, 200)

  • Disable the scroll bar when no overflow in the dynamic text field

    I use the UIScrollBar on a dynamic text field. I would like to make the scroll bar is not visible or turn it off if there are no more rows to display when initially displayed. Are there variables in a pile of data L0 I can check to see if the scroll bar can be disabled; 'lines of total in the text field' and 'lines per page' either, something that accomplishes the same thing?

    You can use the textfields maxscroll property to determine if a textfield can display all its text without scrolling.

  • Dynamic text - entire paragraph is "BOLD" instead of a single word

    I created my website in Flash and I use dynamic text with a scroll bar. I want just the first couple of words in a paragraph to show bold and the rest plain. It seems well in Flash but when I publish it, the whole paragraph is "BOLD".

    I did the incorporation with Auto Fill character.

    Here are the Flash file to see what I mean (about us):
    http://www.swproductions.com/

    I appreciate the advice or opinions.

    Thank you!
    Scot

    tallscot,

    > Basically I can't a single word in a paragraph
    > be bold without making the whole paragraph "BOLD".

    It is one of these "problems" with the dynamic text fields. Static text
    fields behave differently - which means, they allow you to change the style on
    some words or characters, same, but for dynamic text fields, you will have
    must use the class TextFormat give you this same flexibility.
    even if you type the text by hand. This applies to the color of the text, by the
    way.

    The TextFormat class allows you to apply your changes to a text as a field
    whole or in part:

    var fmt:TextFormat = new TextFormat();
    FMT. Bold = true;
    FMT. Color = 0xFF0000;

    all the...
    someTextFieldInstanceName.setTextFormat (fmt);

    specific characters or...
    someTextFieldInstanceName.setTextFormat (0, 5, fmt);

    David Stiller
    Adobe Community Expert
    Dev blog, http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Dynamic text to scroll more than one line

    Hello, been racking my brain for weeks with that. trying to get my external dynamic text loaded to scroll. My code to do appear and scroll down to a single line at a time works fine, but if I replace the code 'scroll buttons' with the code "NEW buttons scroll" to try to get the ti to scroll more than one line - it scrolls is no longer at all. I included my code below in the hope that maybe, it is a problem of simple target path. Thank you!

    change the .scroll + / = 1 to a value greater than 1 to scroll more lines. 1 = 1 line

  • Scroll bar with the dynamic text field?

    I have a dynamic text field, multi-line. I have attached a scrollbar to it using drag component / move.

    It is empty, but gets text thrown in through the appendText() method when the user clicks a button.

    It works, but if there are more lines which fits in the text field, the scroll bar does not "activate" and allow the user to scroll to see it all.

    I'm sure I'm missing something simple here, can someone please help. Thank you.

    Use the scroll bar update() method after text is added.

  • Definition of the size of the image in the dynamic text box

    I have a dynamic text box in which I'm embedding an image.  The following code fills the text box

    infoBox.informationText.htmlText=
         "<font size='16' color='#FFFAF0'>"+calledMarkerIndex+
         "\n<font size='14' color='#FFFAF0'>"+calledMarkerDate+
         "<img src='http://jacobull.files.wordpress.com/2010/06/ween.jpg'/>"+
         "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<font size='12' color='#FFFAF0'>"+calledMarkerDescription;
    

    How set the size of the image in the code above.  I tried to insert the width and height parameters after the path of the image, but an error is generated.  I would like for the width of the image to be as wide as the text of infoBox.informationText Dynamics

    Any suggestions?

    Also the path to each image corresponds to a variable called calledMarkerContent how could put the img src is equal to the variable called calledMarkerContent?

    Hello J,

    If you use a component to scroll, you can eventually use the ScrollPane for movieclips instead.

    The Adobe AS2 components reference:

    " The ScrollPane component to view video clips, the JPEGs and SWFs in a scrollable area. Using a scroll pane, you can limit the amount of space occupied by these types of media screen. The scroll pane can display the content loaded from a local drive or on the Internet. You can set this content during programming and execution with ActionScript. "page 1093 "

    This way you could integrate the area of dynamic text (for your text) both the movieclip (which has the text for your image inside box) that you can then scale them both in an another movieclip (parent), you use the ScrollPane component on.

    This way your text in dynamic text field dimensionnera not, the image can be scaleed to the size of what ever you like (dynamically) and if the two are sitting in a parent movieclip, this parent movieclip may have a ScrollPane component on it.

    How does that sound?

    Best regards

    Chris

  • Add dynamic text to a document fla class-ed

    I have a main menubar.fla file, which has a document on this link class to a menubar.as. the as3 file is just simple Papervision3d stuff and creates a few buttons on the stage from the library.

    Here you can see the project as it is now

    I am trying to ensure when the mouse leaves, the head will be tween to go forward. But to find the mouse leaveing, I use the code found HERE

    In a FLA without a document class, it works fine, but when I add to my menubar.fla I get errors:

    1046: type was not found or is not a constant of compilation: TextField.
    1180: call to a method may be undefined addFrameScript.

    One comes from the only text box on the stage.


    I am new to AS3 and I think what causes this problem is when you define a document class, it doesn't matter THAT the substance that is listed in the corresponding TO the file. If you do not, it loads all the flash components? If this is the case... all I have to do is to add some import lines in the AS file? and what lines?

    I had a similar problem when adding buttons, that finally made me connect for actionscript and just create them directly in the folder, because placing them on the scene threw similar errors. I'd do it too for this code, but according to the website of the source, "this event is only available added in step."

    pointers? and the code that I add to the timeline is below, I have a text field on the stage, dynamic, named test_txt

    ATTACHED CODE

    I would change my post above, if I could, but for some reason I can't...

    in any case, I found my problem. My account has been the extension of Sprite instead of MovieClip. This is no timeline for this code to be added to the record.

    everything works now :) Thanks for the help!

    So in summary the reference solution:

    I had to add these imports:

    import flash.text.TextField;
    import flash.display.MovieClip;

    and I had to make the main class extend MovieClip instead of Sprite

    public class menuBar extends MovieClip

  • AS3 SharedObject of dynamic text field entry into other frameworks...

    Hello I have the script:

    var gTeams:Array = new Array (teamName1, teamName2, teamName3);

    var so:SharedObject = SharedObject.getLocal ("dataSO");

    var shared_data:String;

    for (var i: int = 0; i < gTeams.length; i ++) {}

    If (["team_name_" + i] so.data) {}

    gTeams [i] .text = so.data ["team_name_" + i];

    }

    }

    function saveTextF (): void {}

    for (i = 0; i < gTeams.length; i ++) {}

    so. Data ["team_name_" + i] = gTeams [i]. Text;

    }

    so. Flush();

    }

    In other settings, I have dynamic text fields:

    tName1, tName2, tName3.

    But I can't get the text in the text entry fields.

    How can I do?


    Thanks for your help

    Use instead of TextEvent.TEXT_INPUT Event.CHANGE:

    teamName1.addEventListener (Event.CHANGE, tName1F);

    function tName1F(e:Event):void {}

    .

    .

    .

    Note that the response number 8 is the right answer to your question.

  • Get the content of the dynamic text

    I have a dynamic text 'Home_btn' with the 'Home', 'Preview_btn' content 'Preview' content and so on...

    I have another dynamic text 'title_txt' and I need to get content txt of the buttons to change the "Title_txt' when the button was clicked.

    my code...

    function clickBtn(evtObj:MouseEvent) {}

    title_txt. Text = evtObj.Target.Name;

    }

    but this, get the name of the event target.

    Can someone help me?

    If you mean you want the text inside the buttons to display in your title_txt, then target the textfield object.  Each button must have the same name for the textfield object so that you can target any of them...

    function clickBtn(evtObj:MouseEvent) {}

    title_txt. Text = MovieClip (evtObj.currentTarget).textfieldName.text;

    }

    where textfieldName is any name assign you to the textfield object

  • Create a script of the class dynamic text field

    Hi all

    I came across a few subjects that relate to t my question but after reading, try different approaches and internet research, I'm still confused. How to create Visual elements, for example a text field, dynamically from Actionscript in a class file?

    Basically, I created a class file that loads an external XML file and now I want to create fields of dynamic text for the items in the XML file. I did some debugging and I know that the XML is properly loaded. I can also get it to create dynamic text fields when I place the code inside the fla. The problem is when the code is in the class file. I read that you must pass the display for the class object, but I'm still not clear on how to do it.

    Any help would be greatly appreciated! Thank you in advance!

    My fla has the following code on the first frame:

    Import classes.estimatesheet;

    var sheet1:estimatesheet = new estimatesheet("xml/estimationSheetFields.xml");

    Here's my class file:

    {classes package

    flash.xml import. *;
    import flash.display. *;
    import flash.events. *;
    flash.net import. *;
    import flash.utils. *;
    import flash.text. *;

    public class estimatesheet extends Sprite {}

    public var textFields:Array = new Array();

    public void estimatesheet (file:String) {}

    xmlLoader (file);

    }

    public void xmlLoader (file:String) {}
    var loader: URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.TEXT;
    loader.addEventListener (Event.COMPLETE, handleComplete);
    Loader.Load (new URLRequest (file));
    }

    public void handleComplete(event:Event) {}
    try {}
    var allXml = new XML (event.target.data);

    {for each var item: XML (in {allXml.elements ())}
    createSheet (element);
    }

    } catch {(e:TypeError)}
    trace ("cannot parse for XML");
    trace (e.message);
    }
    }

    public void createSheet(data:XML) {}

    var textFormat:TextFormat = new TextFormat ("Verdana", 11);

    {for each var item: XML (in {data.elements ())}

    var textField:TextField = new TextField();
    textField.setTextFormat (textFormat);
    textField.text = element.@label;
    textField.x = 150 * i;
    textField.y = 150 * I
    stage.addChild (textField);
    i ++ ;
    }

    }
    }

    Each feature display MovieClip, Sprite, TextField, etc. should be added to the display list/stack. The addChild in your class only adds TextFields to the estimatesheet class by using addChild (textField) and adds them to the scene of the film using stage.addChild (textField). Note that the latest works if estimatesheet is added to the movie because if estimatesheet is not added to the film the stage property is zero and you can't add items to something that is null, does not exist. AddChild (estimatesheet) prepares the ground for reference the main movie.

    As for making your class of the document class, you need to rearrange some things in your class and add a way to load the XML file. Things aren't sure how flexible can be.

    Sean

Maybe you are looking for

  • How to set iSCSI CHAP Username with OS6

    Hello. I upgraded my loan NAS Pro 4 to OS6 ready (thanks to Netgear, great support!) and want to use CHAP on my iSCSI on debian virtual computer connection. Before with OS4, I can put some user name with OS6 I don't find something to set it. Somewher

  • T400, a pixel stuck in fullscreen

    I just got my T400 2 days ago, now I find a stuck pixel (it's blue) in the center of the screen. Please tell me if I can get a replacement from lenovo. Thank you!

  • Activating Windows 10 - digital law

    There has been many questions about the Activation of Windows 10 and queries for "product keys". In the case of Win8x and new machines is incorporated in the UEFI (Unified Extensible Firmware Interface) the motherboard firmware and this is done by th

  • 1 Question, 1 Suggestion video

    My question is about the videos on the Sansa.  When I turn my Sansa while playing a video, I turn it back on and it shows a screen capture of screen-pause. Yet, when I try to start the video, nothing happening... just the play and pause buttons / Exc

  • move libraries in win7

    Hi, I installed the propulsion system hybrid momentus xt on my laptop dv7 under windows7 64 bit home premium, I have partitioned my drive and would be good, move my libraries too the second partition (independent from operating system) is a way to ac