make symbol of width equal to the dynamically added content

Hey everybody,

I have a nav menu with 4 cases of a toggle button symbol that contains a text element name "label". After compositionReady I'm iterating over each instance and change the 'label' to another value that I load from a table. I can swap the names easy enough using. each(), but can't find out how to change the width of the symbol on the width of the text content, so that they do not overlap.

Any suggestions? Thank you

Dave

I got it!

resdesign, thanks for the link. I tried to add a tag around the text of the label as the suggested link - which worked - but I found that for some reason, he added in the width of the symbol, more the width of the text child element. So I changed the width property of the symbol to 'auto' and it worked like a charm... didn't need even the tags more - that will keep more net.

Thanks again for the input. I believe that the members of this forum are most useful to any forum that I've never been outside.

Here is the final code:

labels of var is ['LABEL', 'LABEL LONG A', "A REALLY LONG LABEL", "LBL"];.

xPos var = 400;

for (var i = 0; i)< labels.length;="">

var newBtn = sym.createChildSymbol ('toggle_btn', 'navBar');

var btnLabel = "" + labels [i] + ""; "

newBtn. $(«label») .html (btnLabel);

newBtn. $(«label») .html (labels [i]);

newBtn.getSymbolElement (.css({))

'display': 'inline-block ',.

'white-space': 'nowrap '.

'left': xPos,.

'Width': 'auto',

'top': 10

});

Console.log ("menu button" + i + "added to" + xPos + "px");

xPos += (newBtn.$("label").width () + 20);

}

And a link to the zipped files:

https://www.dropbox.com/s/5n2hj5kppp6wdky/test3.zip

Thank you very much!

David

Tags: Edge Animate

Similar Questions

  • [HTML only Articles] dynamically adding content does not scroll through the article.

    Hello

    I noticed that if I dynamically change the content of the article (for example, to add a paragraph of information) then the scroll bar WebView external will not update to make it me access the new maximum height of article. I don't know if it's a "designed as" side webview iOS or if something

    More simple example to illustrate what I'm saying;

    1. create the new article with basic html structure

    2 make a button that adds a 50px x 50px div

    3 - Repeat until the divs are off the screen.

    The overall scroll webview bar will not be updated and let to display the new content. Once I have rotate from landscape to portrait (or), the new content is properly 'dropdown' - until I have add (rotation arrange once again, rinse repeat).

    I put put workarounds in place for this, by wrapping everything in width x height wrapper and enabling scrolling on this outer shell. This seems to solve the problem in most cases, but I wanted to see if anyone had a keen workarounds for this device or that solution happens

    -Mark

    Unfortunately, this is how it works. The outside view calculates the size when the content is loaded for the first time. There is no way to tell the outside view to update to the new size.

    Neil

  • Allocation of shares to the dynamically added buttons.

    Hello

    Here's my problem, I'm adding buttons to step execution and for the life of my I can't have shares in them to work. Now when I click the button nothing happens. Am I missing something?

    Well, it seems I've found the reason why. For starters, I dropped the whole thing look.

    What I was trying to accomplish was to choose an image that has been associated with the number of the button to say "image_1" has "button_1. So what I wanted was that when I clicked on "button_1", he would send the number to the showImage() function.

    NOTE: I discovered after a few hours I could just add the variable x in the function as in...

    this.adButton.onRelease = function()
    {
    showAdImage (x);
    }

    ... because it reminds the current value of x that would eventually be someNum. So FYI, call events will call the current values of all variables.

    SO MY SOLUTION...
    The way I had the time it was simply call the name of buttons with "this" and turn it into a string variable. I then shared using split() and grabbed the number.

    Once this has been done well all worked.

    This is the final code.

    ...

    for (x = 0; x< somenum;="" x++)="">

    name and create the button...
    btnName = "adButton_" + x;
    this.attachMovie ("btn", btnName, this.getNextHighestDepth ());

    get the button...
    adButton = eval (btnName);

    button position...
    this.adButton._x = somePosX;
    this.adButton._y = somePosY;
    this.adButton._width = someWidth;

    define and Add button actions...
    this.adButton.onRelease = function() {}
    imThis = what + "";
    I have = imThis.split ("_level0.adButton_");
    showAdImage (i [1]);
    }
    }

    ...

  • Unit test: is there a way to make the dynamic query of the value of running after the boot process?

    I wonder why the dynamic value query is executed before the boot process? Logically, it makes sense to run after them.

    For example, I test a stored procedure that is supposed to delete a record, and I'd like to create this test report should be deleted as part of the startup process before execution of the stored procedure call to delete this test record. Apparently the dynamic query of value not returns not the test report in as long as the query parameter to call the stored procedure under test, which makes me think that is executed before the startup process of design...

    Please advise...

    Thank you

    Val

    As this thread does no traction/attention of the team of SQL Developer for a while, I had to submit a request for formal improvement on metalink:

    RE: 19834977 - IN THE UNIT TEST REQUEST TO ALLOW TO CHANGE THE ORDER OF EXECUTION OF THE START OF THE PROCESS

    Thank you

    Val

  • How to make a label (javafx) to display the current time dynamically?

    Hi all

    How to make a label (javafx) to display the current time dynamically?

    I have not found a Type of event related to the time in javafx API.

    Please give me some suggestions. Thank you!

    Sage

    There are lots of examples of JavaFX clocks available, for example https://gist.github.com/jewelsea/3388637 or http://blog.crisp.se/2012/08/09/perlundholm/an-analog-clock-in-javafx

    For a simple label displaying the time, the simplest thing is to create a Timeline with duration 1 second and the number of indefinite cycle, which triggers an event handler that updates the label:

    final Label clock = new Label();
    final DateFormat format = DateFormat.getInstance();
    final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler() {
         @Override
         public void handle(ActionEvent event) {
              final Calendar cal = Calendar.getInstance();
              clock.setText(format.format(cal.getTime());
         }
    });
    timeline.setCycleCount(Animation.INDEFINITE);
    timeline.play();
    

    (If you use Java 8, use the new time API, which is much more pleasant than calendar.)

  • Make a Table of the dynamic contents for a document with a liquid layout... Help!

    * Running LiveCycle ES4 and use of the 'action' to code generator *.

    I have a HUGE document (70 + pages) that needs a dynamic table of content that updates the user adds information that can push all the sections that follow to the new page numbers.  There are sections AND subsections under each article, but for this, lets keep things simple and just talk sections.  I had to face to find a way to do this for months and I need to have done this week. I already have the table of contents and click on each section heading, it sets the focus to the PDF for the first text field in this section.  (each section has a text field just after the title of section)


    To make it dynamic, I added 2 pieces for each section:

    (1) a field of visible text on the Table of contents page with the default page number that the article is on until the user enters information

    2) an invisible digital field placed just before the first text field in each section that of value is set on "property page number: current runtime" so he always holds the current page number


    Using the constructor Action, what I do is every time a textfield is changed, change the value of the table visible from the field content of this section to the value of the invisible digital field that is now the current page number.  There are 7 sections, so if the text of article 2 field is changed, then update the Table of contents to sections 3-7.


    Screen Shot 2015-01-27 at 12.05.36 PM.png


    When I tested on a single article, it worked.  But now it does not work and I do not know why.


    Here are some properties of the object than my being at the origin of the problems too. If anything sticks?


    Visible box on the table of contents page

    Domain: Type = text field

    Value: Type = Protected (I was cycling through all THE different types, but the only time where it worked, it was the Type of value)


    Invisible box above the first textfield in each section

    Domain: Type = numeric field

    Value: Type = calculated - read-only property of execution: current Page number


    any suggestions? Thank you!

    This has never answered, but I understand on mine.  Figured since it had 66 times, I would like to share what I found.  It was actually an easy fix.

    I added a textfield (set to display the current page number of the page on which it is) at the beginning of each section that appears in the table of contents and set it to always stay with the first line of text in this section as well as the document grew, the page number, in that the section begins will remain correct.  Place to hide it.  In the "binding" tab, I put the name is the same name as the corresponding heading in the table of contents.

    Hope this helps someone who is in my place last year. =)

  • How to make the dynamic source path

    Hello
    I am new to flex. Here is my problem

    < mx:HorizontalList id = 'horizontalList' height = '100' columnCount = dataProvider "6" = "(arr)" >
    < mx:itemRenderer >
    < mx:Component >
    "< mx:Image width ="100"height ="100"source ="... /... / user/Sebastian/weeding/album / {data} "/ > /mx:Component >"
    < / mx:itemRenderer >
    < / mx:HorizontalList >

    I want to do the dynamic source path. I mean I've collected the username and albumName of php and I could print in flex. But when I use a source like that this source path ="... /... "/utilisateur/ {userName} / {albumName} /album/ {data} ' I love the error. How can I fix that please help me

    declare these two BINDABLE variables in the main file.

    [Bindable] private var userName:String;

    [Bindable] private var albumName:String;

    .

    .

    .

    .

  • Determine the width of the dynamic text

    I have a dynamic text on top box a moviclip of a rectangle.  I need the width of the rectangle movieclip to adjust according to the width of the characters in the dynamic text box.  Is it possible to determine the width of the characters in the dynamic text box?  I can't understand this.  Thanks for any help me direction in the right direction.

    msg0. Width = msg0.textWidth;

  • Newbie question: could not get the widths equal object

    I have two paths of rectangle in my document. I don't remember exactly how I created the, but as far as I know, they are very similar, same fill, none related. They are the two vertical sides of a rectangular border around the perimiter of my doc.

    I would like to change the widths to be the same. Percentage width/height constraints are disabled. I enter the width of an object in the field of the width of the other and of width, but a number of unpredictable changes. I put in a new issue again and the width changes into something new but not what I want. I tried to use different units, same result. I have no problem changing the heights of horizontal paths corresponding to be the numbers I want.

    There is a visible difference between the paths: when the disturbing path is selected, the blue outline around it is wider than the other tracks.

    I ended up throwing the path of boredom and the copy of that good as a workaround. But I would like to know what is happening, I guess I'm missing something basic.

    I hope someone can help.

    It's 'Use Preview Bounds' enabled. If you want to know the details you should read "Why the Transform Palette will do what I ask?" by http://tpettit.best.vwh.net/adobe/index.html

  • 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

  • How to get the name of the instance of button to display in the dynamic text box

    first of all, thank God for you people. Laughing out loud.

    Here is my scenario, I am the designer of consumate and learning coding by leaps and bounds, today its been a lot of stumbling blocks however.

    I have a site I designed that contains buttons that navigate the user at various points on the timeline using image tags. When they arrive at the appropriate image tag, they are presented with a movieclip containing two layers. The bottom layer is a card, and the top layer is a collection of buttons printer having a component tooltip on them showing you the information on detailed mouse printer on and takes you to the Remote UI printer on release. each button has a name of unique queue for the printer appropriate under its name of the instance (e.g. itm100_btn). Here's the jist... I want to be able to place a dynamic text box near the printer and using action script button it display printer queue name automatically simply based on the button, targeting, or even place the dynamic txt area inside the printer button mc. See, on some pages, there are like 24 printers... I'm AFRAID to have to put all these names in manually because there are total 150 printers! OUCH...

    Oh it is AS2.0 with Flash cs4

    In short... God bless you people... for the love of God someone help me? Laughing out loud.

    Thank you so much peoples!

    "I make things look purdy, but do not know why the sky is blue".

    to create a movieclip button:

    create a (insert/new symbol/movieclip) movieclip and attach a stop() to its first image and etiquette 'up '.  create any graphic you want for the up state button movieclip.  create a 'more' and, if necessary, a "low" setting

    When you place this button movieclip on stage give an instance name (for example, printer1) and use:

    {Printer1.onRollOver = Function ()}

    this.gotoAndStop ("over");

    }

    {Printer1.onRollOut = Printer1.onDragOut = Function ()}

    this.gotoAndStop ("up");

    }

    {Printer1.onPress = Function ()}

    this.gotoAndStop ("down");

    }

    and add your onRelease to do all that.

    If you also wanted to add a textfield that displays the instance name of the button when the button is postponed, place a textfield on the framework of the "over" and give it a name instance (say tf) and associated to the MovieClip "over" frame that uses:

    TF. Text = This._name;

  • Images in the dynamic text box?

    I searched high and low trying to find how to insert images in the dynamic text boxes and there are hundreds of solutions. I can't make them work... still too novice.

    Im trying to insert 1 image under a paragraph in a dynamic text box. Fact scroll and areas are defined for "render text as html" and "selectable".

    I have put the following inside the text box code and just show you the code.

    < img src = "images/graph.jpg" width = "194" height = "300" / > "

    What I am doing wrong?

    clbeech... thank you very much. Your help is very appreciated!

  • Sync symbol does not appear in the tab header

    In the version of Android, Firefox, I configured my e-mail address of synchronization, but the sync symbol does not appear where it should (except the symbol of private browsing). The desktop version of Firefox is properly set up with my account, so I have no idea what I can do now to make it work? Thank you.

    Hi snoreau, the tabs sync on android have moved into their own group of experts on the home screen (also known as awesomescreen).

  • After you install a Foxfire 5.0 update, I get this message when you try to open Mozilla: the procedure entry point sqlite3_db_status could not be located in the dynamic link library mozsqlite3.dll.

    I get this message when you try to open Mozilla: the procedure entry point sqlite3_db_status could not be located in the dynamic link library mozsqlite3.dll.

    Do a clean reinstall.

    Download a new copy of Firefox and save the file to the desktop.

    • Uninstall your current version of Firefox.
    • Do not remove the data of a personal nature when you uninstall the current version.

    Delete the program folder Firefox before installing newly downloaded copy of the Firefox installer.

    • It is important to remove the Firefox program folder to delete all the files and make sure that there is no problem with the files that were the remains after uninstallation.

    Your bookmarks and other profile data is stored in the Firefox profile folder and will not be affected by a relocation, but make sure that you do not select delete data of a personal nature if you uninstall Firefox.

  • Insert symbol in word doc using the report generation toolkit

    I'm trying to insert a graduation or a brand of corss the word doc by reading the bookmark. To enter a value, I used a control of the chain. But I have been unable to enter these symbols. I tried to make the insertion of an image, but it is to insert the image but don't replace do not bookmark. Please help me with this!

    ben64 wrote:

    Maybe these symbols are not included in the character set used by Word. Do you have something or nothing, is there an error message?

    Ben64

    Here is an example of what I said:

    I need to insert the check mark, set the font for report to Wingdings (restore the default font after). If I don't do this the character ü is written (0252 default font character).

    Ben64

Maybe you are looking for

  • With the purchase of Qosmio X 70-B-10 t

    Thinking about buying the model above.Not for the games. Seems to be a powerful machine. However, I would like to remove the shdd and replace it with an ssd. It seems that the laptop doesn't have service hatches as in older models that I have. I pres

  • Apple's maps takes place a wrong address

    I've moved the pin code, reported the error several times (over 12). When research apple 9200 Calumet Avenue, Munster, Indiana 46321 cards sends people on the street on the other side as well. However, when searching "dermio dermatology", the exact l

  • Turn on Apple TV after its been asleep

    Received a model Apple TV A1625. Set up, listened to music, watched a few shows from Netflix. Before going to bed, put Apple TV in standby via the remote control according to the instructions. Today, tried to turn on the Apple TV with the remote cont

  • Cannot start Windows Live family safety

    Hi team, I can't start Windows Live family Safety because UXCore.dll is missing from the computer. This happened after upgrade Windows 10 and return to Windows 7 Home Premium 64-bit. I returned to Windows 7 because I didn't like the way windows Famil

  • No DHCP and no config mannual?

    If a device wants to communicate with another device and if there is no DHCP server on the network and the manual configuration of the address is not possible, how the two devices on the same link will communicate?