Wrapping text inside a movie clip/textfield?

I got a text from XML, its loading within textfields 'my_Text' inside a movieclip "clip_mc"... How to do the either of these wrap width?
The text just runs off the screen, I need to stay inside a box... someone knows how it can be done?



Stop();


var yPlacement0:int = 80;
var xPlacement0:int = 80;
var yPlacement:int = 20;
var xPlacement:int = 30;
var distance: int = 60;


var myXML:XML = new XML();
var XML_URL:String = "artist1.xml";
var myXMLURL:URLRequest = new URLRequest (XML_URL);
var myLoader:URLLoader = new URLLoader (myXMLURL);
myLoader.addEventListener ("complete", xmlLoaded);


function xmlLoaded(event:Event):void {}

myXML = XML (myLoader.data);
var xmlDoc:XMLDocument = new XMLDocument();
xmlDoc.ignoreWhite = true;
var menuXML:XML = XML (myLoader.data);
xmlDoc.parseXML (menuXML.toXMLString ());

HOME INFO
EVENTS
for each (var ListItem:XML in myXML... ListItem) {}

var listMainInfo:String = ListItem.itemMainInfo.toString ();
var listLabel:String = ListItem.itemLabel.toString ();
var listDate:String = ListItem.itemDate.toString ();
var listDescription:String = ListItem.itemDescription.toString ();

var myText0:TextField = new TextField();
myText0.text = listMainInfo;
myText0.autoSize = TextFieldAutoSize.LEFT;
myText0.x = 24;
myText0.width = 200;
myText0.y = 130;
addChild (myText0);

var myText1:TextField = new TextField();
myText1.text = listLabel;
myText1.autoSize = TextFieldAutoSize.LEFT;
myText1.x = 200;
myText1.y = 2;
var format: TextFormat = new TextFormat();
format. Size = 26;
myText1.setTextFormat (format);
addChild (myText1);

var myText2:TextField = new TextField();
myText2.text = listDate;
myText2.autoSize = TextFieldAutoSize.LEFT;
myText2.x = 200;
myText2.y = 30;
myText2.wordWrap = true;
addChild (myText2);

var myText3:TextField = new TextField();
myText3.text = listDescription;
myText3.autoSize = TextFieldAutoSize.LEFT;
myText3.x = 200;
myText3.y = 50;
addChild (myText3);


var clip_mc = new MovieClip();
clip_mc. AddChild (myText0);
clip_mc.WordWrap = true;
clip_mc. AddChild (myText1);
clip_mc. AddChild (myText2);
clip_mc. AddChild (myText3);
addChild (clip_mc);

clip_mc.y = yPlacement;
clip_mc.x = xPlacement;
yPlacement = yPlacement + distance;
}
}

use:

var myText0:TextField = new TextField();

myText0.multiline = true;

myText0.wordWrap = true;
myText0.text = listMainInfo;
myText0.autoSize = TextFieldAutoSize.LEFT;
myText0.x = 24;
myText0.width = 200;
myText0.y = 130;
addChild (myText0);

Tags: Adobe Animate

Similar Questions

  • Clickable button inside the movie clip symbol?

    I would like to know how I can have clickable buttons inside a movie clip symbol.


    Thank you.

    Your problem is mainly code compared to the location of objects location. When you start the file, the keys 1 to 8 are classified under code because they are visible, while the 9-11 thru buttons are not because they live in a non-current setting of the miniature timeline. When you switch to the side MORE things, these buttons is not any code assigned to them, and when you come back, the same is true for the first eight buttons because they were out of the picture and lost their connection to any code (the previous assignments have been already spent to frame 1 of the main timeline).

    What you should probably do is locate your button code for frames where the buttons in the thumbnail movieclip. In this way, their code is always where they are. The code of the keys 1 to 8 will be in frame 1 of the miniature clip and the code for 9 to 11 will be in frame 2. You need to change the code for the form:

    thumb1.onRelease = function() {}
    _parent.gotoAndPlay("1");
    };

    And you're going to do you a favor if you do not use the numbers of the labels.

  • AS3 putting the buttons inside the Movie Clip

    I'm practicing AS3 (after years of AS2) and can't have a button inside of a clip speaks to another clip on the main timeline. Here is the code:

    OneButton.addEventListener (MouseEvent.CLICK, OneButtonClicked);

    function OneButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (1);

    MovieDescription.gotoAndStop ("One");

    }

    TwoButton.addEventListener (MouseEvent.CLICK, TwoButtonClicked);

    function TwoButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (2);

    MovieDescription.gotoAndStop ("Two");

    }

    The code above works, but if I put OneButton and channels within a clip, I know can target the MovieTarget and MovieDescription. The reason that I want to put OneButton and strings inside it's own MC is so I can dim each hit after top by switching the playhead within this MC help. ? Thank you!

    Start from the beginning

    Press f8 and choose movieClip, then draw your button movie untoggled call then create another movie and create your button toggled or grayed button and call it greyedButton.  Go to the main stage add 2 instances of button and 2 greyedButton (just drag the library).  you have 4 instances on stage.  give the name of the instances of appeal and place them one over the other so you can see 2 buttons on the stage.  put the button greyed under the button.

    now with action script

    Button1.addEventListener (MouseEvent.CLICK, OneButtonClicked);

    function OneButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (1);

    MovieDescription.gotoAndStop ("One");

    Button1.visible = false; Here the button greyed will show

    }

    Button2.addEventListener (MouseEvent.CLICK, TwoButtonClicked);

    function TwoButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (2);

    MovieDescription.gotoAndStop ("Two");

    Button1.Visible = true; Here button1 will return to its orignal State

    Button2.visible = false / / here will show the button greyed

    }

  • Button inside the Movie Clip

    I need to find a way to make a clip or a button click on, and then lead to a clip that opens a window with data and has a box of x to leave this movie clip. I also need this box WITH the x to be moved together. I can't get the closing work, anyone can please help? !

    See my account for more details please

    //Louisville,CO -------------------------------
    
    louisville_btn.onPress = function () {
         louisville_box.gotoAndPlay("play");
    }
    // DRAG
    louisville_box.onPress = function(){
         startDrag(louisville_box);
    }
    louisville_box.onRelease = louisville_box.onReleaseOutside = function(){
         stopDrag();
    }
    
    louisville_drag.closeBox.onPress = function() {
         startDrag(this._parent);
    };
    
    louisville_drag.closeBox.onRelease = function() {
         stopDrag();
    };
    
    closeBox.onRelease = function() {
         louisville_box.gotoAndStop("stop"); 
         };
    

    Since you will have a lot of cities, buttons boxesand sharing the same code, it is best to put all the code in the main storyline (the first image).

    If you write code at the beginning that refers to an object that is not currently part of the scene (such as a button that is located on the second frame of a movieclip, which has a code stop() on the first picture), this code never reached its target.

    Similar: If you catch a MouseEvent as onRelease at the parent level, the event is not registered for the child.

    Hope that the attachment is what you had in mind.

    Nice graphic btw

  • How can I play a clip inside another movie clip?

    Hello

    I want to clip playa when I click on the video clip of ona nother

    How can I do?

    Thank you

    The following text uses the names of generic instance according to your description, so you'll have to change the name to agree with your design.

    anotherMovieclip.addEventListener (MouseEvent.CLICK, play_aMovieclip);

    function play_aMovieclip(evt:MouseEvent):void {}

    aMovieclip.play ();

    }

  • Animation inside the movie clip symbols in the part "header" of the web site

    Question: should I do a header animation of the website. seconds, it happens and is stopped with action script command stop(); but I need an elenment inside the flash header continue to animate like here: http://ves-lab.ru/ a scalable logo in the upper left corner of the header. If somewhere the answer has already been written - someone write a link to this source. Thank you.

    Make this entity that continues to animate a separate with its own animation movieClip.

  • Help. Button inside the Movie Clip will not work

    So I have a MovieClip (the instance name: menu) which has a transition used on it, so I had to put the (House) button, I wanted to work on the parent (main) layer inside the MovieClip, but it does not work on the parent layer. Why is this? What should I do?

    You are welcome.

  • Help. Video clip inside a movie clip problem

    I have a movieclip (left with alibis and lying eyes) in a movieclip (watch) and I have buttons on the breast left with alibis and lying eyes I want to go to the labels/images specific to the breast to look at. I tried to do:

    (release)
    {
    watching.gotoAndStop ("one");
    }


    But it did not work. Do you have any suggestions?

    the function() trace to determine the correct path (you can use trace (this) on any scenario to see its absolute path) and ensure the required movieclip exists when the button is released.

  • How can access a button inside the video clip

    I have a button named a_btn. This button is located in a clip name a_mc passage. This button is on the first frame. then when you write the code for that:

    function submit(event:MouseEvent):void

    {

    trace ("hii")

    }

    a_mc.a_btn.addEventListener (MouseEvent.Click, Submit);

    his work. but when I keep this button on 2nd chassis or anywhere not in 1 frame inside that movie clip, then I get error runtime as:
    TypeError: Error #1009: cannot access a property or method of a null object reference.
    to NewFlashDocument_fla::MainTimeline / NewFlashDocument_fla::frame1 ().
    How can I access this button on the second picture...

    You cannot reference an object until there are.  Thus, if a_btn is on the 2nd frame of a_mc, you must wait until this 2nd frame plays before trying to refer to a_mc.a_btn.

    If not, put a_btn on the first image and set its visible property to false in the first frame and true as part of the 2nd.  Then you can use your current code and duplicate the design you are trying to achieve by moving the button on the 2nd frame.

  • Drag a clip movie with dynamic text inside box?

    Hi team, I can slide a movieclip with static text inside, but when I change the dynamic text, I get a not found Startdrag property on Flash.text.textfield and there is no default value. Any help?

    See you soon

    void

    assign to your movieclip on false mouseChildren property.

  • How to load dynamic text inside a clip?

    Hello all - I have a main scene on the first picture where my 'home' film clip shows. I did it by drag and drop, and then I put a stop action. everything works very well.

    inside this clip of family movie on the main stage, there are links to other video clips. for example, to access my faq page - you click on this button, then it takes you to box 4 on my main stage, where the video clip of my faq (followed by stop action) was dragged/dropped and displays properly.

    in the video clip of the faq, this process is repeated, with buttons taking you different pages (different images to different video clips play - everything works fine).

    so now, I want to add a dynamic text field in the video clip of my faq. I've read many tutorials where I created the text file, but I was not able to view successfully within my video clip of FAQ.

    Here is a code that tells my tutorial dvd place me on the main stage that I practice how it works:

    var myMCL:MovieClipLoader = new MovieClipLoader ();
    var myListener:Object = new Object();

    myMCL.addListener (myListener);


    var myLV:LoadVars = new LoadVars();

    myLV.onLoad = function (success: Boolean) {}
    If (success) {}
    _level5.loadedInfo.htmlText = myLV.info;
    } else {}
    _level5.loadedInfo.text = 'there was an error loading the requested information. Please contact the site administrator. « ;
    }
    }

    and here's some code that I place on the FAQ button in my main video which brings back me to the main stage and plays faq movie clip all passed:

    on (release) {}

    GotoAndPlay MovieClip behavior
    _root.gotoAndPlay("4");
    End behavior

    }

    and finally, here is that some code that I put in my clip from movie FAQ in an attempt to display my dynamic text in the FAQ clip - so far without success:

    _level0.myLV.load("VARs/FAQs.txt");

    NOTE:
    I published this see - does not.
    I have my text FAQ starting as info = file
    I eliminated white spaces in my text file
    I use flash 8 pro

    can anyone offer some suggestions? Thank you!

    Hey clBeech - I GOT it! YAHOOO!

    Man - I've been racking my brain and took off a few days of this problem - it turns out that your second post was the answer - he just took clearing me my head to look at once again - I solved all of this as an hour ago - is the code - set 4 main Timeline frame that has worked:

    [
    Stop();
    var myLV:LoadVars = new LoadVars();

    myLV.onLoad = function (success: Boolean) {}
    If (success) {}
    _level0.mainfaqs.loadedInfo.text = myLV.info;
    } else {}
    _level0.mainfaqs.loadedInfo.text = 'there was an error loading the requested information. Please contact the site administrator. « ;
    }
    }

    myLV.load("vars/faqs.txt");

    ]

    I can't thank you enough - although this was not a BIG problem of programming, I couldn't proceed without him, and it was big for me. Thank you for taking the time to following up with me - seriously!

    now, I continue with my project - the scroll for my dynamic text buttons - everything seems to work.

    have a great weekend my friend!

  • How to create a movie clip and place the other clips to move inside?

    I followed a tutorial of ping pong (http://www.webzo.org/tutorials/flash/ping-pong-ball-movement.php).

    In the fourth step, it is said to

    4 - inside another Clip named 'Limits' place 'Pads' and the 'wall '.                           Name of the instance of the pads should be "Pads" and instance of the wall called "border".
    We put the wall and trim inside the same Clip, to use it in order to know when the balloon is collided. And we could not put everything together because the ball behaves differently if hit the wall instead of the pads.

    How to create this clip and put the other clips of film "inside"? Also, if anyone can find, where should I put this clip? Should I put it in the same place as the wall?

    Please help out me.

    When you double-click a movieclip to open for editing, you have a work space to put things inside this movieclip.  That's what I call its Stadium.

  • Dynamic text field will not wrap text

    I have a dynamic text field in my clip. This text field has built-in fonts and behavior is set to Multiline.  When I add text to it, it will not display text that wraps past the first line.

    var textField:TextField = tip_txt; text inside my video field

    trace() "before textField.numLines =" ( + textField.numLines); "."

    textField.text = "test a verrrrry looooooooong striiiinnnnnnnnnnnggggggg";

    trace () "after textField.numLines =" ( + textField.numLines); "."

    Track orders show that the number of lines is increasing, but Flash does not display the text beyond the first line.  Anyone have any idea whats going on?

    Thank you!

    textField.autoSize = TextFieldAutoSize.LEFT;

    This fixes the issue :))

  • Cannot add event listener to instantiated Movie Clip

    Hi guys,.

    I have a clip that I'm loading dynamically in my scene when a key is pressed.  Then, I would like to add a mouse event listener to the Movie Clip object so it can trigger a function when clicked.  I get an error when you try to do this and cannot find a solution anywhere.

    Here is my code:

    newLayerBT.addEventListener (MouseEvent.CLICK, newLayerBT_CLICK);

    function newLayerBT_CLICK (MouseEvent): void {}

    layerCount = layerCount + 1;

    Make a new object in my class BlankLayerMC

    var newLayer:BlankLayerMC = new BlankLayerMC;

    addChild (newLayer);

    Position the new object

    newLayer.y = prevY + newLayer.height;

    Change the text inside the object in order to take account layerCount courses

    newLayer.layerName.text = 'Layer' + layerCount;

    newLayer.layerNum = layerCount;

    prevY = newLayer.y;

    My problem occurs with this line...

    newLayer.addEventListener (MouseEvent.CLICK, moveSelection);

    layerArray.push (newLayer);

    }

    function moveSelection(e:MouseEvent):void {}

    var t = e.target;

    layerSelectedGraphic.x = t.x;

    t.y = layerSelectedGraphic.y;

    }

    Any help would be greatly appreciated

    change:

    function newLayerBT_CLICK (MouseEvent): void {}

    TO:

    function newLayerBT_CLICK(e:MouseEvent):void {}

  • Can't see Movie clip on stage in swf

    Why can't I see the berries of movie clip of gameLoop running with the code below?

    The film clips show perfectly when he was in another class file.

    I made that is not just behind other graaphics turning enything remains off.

    I know gameLoop runs because all his trace statements work.

    All I changed was the code below. There is no error message:

    package

    {

    import flash.display.MovieClip;

    import flash.text.TextField;

    import flash.events.Event;

    import flash.utils.Timer;

    import flash.events. *;

    / public dynamic class WordArray extends MovieClip

    {

    public var wordtext:wordText = new wordText;

    var activeWordArray:Array;

    public var wordsL1:Array = ['elephant', 'a', 'of', 'off', 'walk', 'no', 'got', 'in', 'East', 'it'];

    private var tf:TextField;

    public var letterArray:LetterArray;

    public var tileTimer = new Timer (500,384);

    the constructor code

    public void WordArray(_tf:TextField)

    {

    TF = _tf;

    nextWordF();

    * Run letter tiles Start *.

    letterArray = new LetterArray();

    addChild (letterArray);

    tileTimer.addEventListener (TimerEvent.TIMER, gameLoop);

    tileTimer.start ();

    }

    public void gameLoop(timerEvent:TimerEvent):void //This gameLoop a movieclips in

    an array that must be run in the swf file.

    All trace instructions work,

    but it is certainly not visible on the screen.

    {

    trace ("tile timer started");

    letterArray.gameLoop ();

    }

    * end of letterTile code *.

    You should not code in hard activeArray.  You must pass this LetterArray activeArray.

Maybe you are looking for