Search Results

Search found 11 results on 1 pages for 'tlf'.

Page 1/1 | 1 

  • Fast way to set text format for a range of Text using TLF

    - by wezzy
    Hi, i have to set the text format for some tokens in a plain text. I'm trying to use the Text Layout Framework to improve the speed of the operation but i've founded that TLF is far slower (10X in my tests) than the old setTextFormat(). For each token i call this function: public function setTextFormat(format:TextLayoutFormat, begin:int, end:int):void{ var selection:SelectionState = new SelectionState(this._textFlow, begin, end, this._normalFormat); IEditManager(_textFlow.interactionManager).applyLeafFormat(format, selection); } is there any faster and clever way to do this operation ? Thanks

    Read the article

  • How to display only one letter in Flex Text Layout Framework ContainerController?

    - by rattkin
    I'm trying to implement dropped initials feature into my Flex application. Since Text Layout Framework does not support floating, the only known solution is to create additional containers that will be linked together, displaying the same textflow. Width and positioning of these containers has to be set in such a way that it will pretend that it's float. I'm using the same solution for dropped initials. Basically, I'm creating three containers, one for the initial letter (first letter in text flow), the other for text floating around, and the 3rd one to display text below these two. All these containers share one textflow. I have big issues with forcing controller to display only one letter from the text flow, and size it accordingly, so that it wont take any unnecessary aditional space and won't get any more text into it. Using ContainerController.getContentBounds() returns me size of whole sprite of the letter (with ascent/descent empty parts), not the height/width of the actual rendered letter. I'm using textFlow.flowComposer.getLineAt(0).getTextLine().getAtomBounds(0), but i think it's still not right. Also, even if I set container for this dimensions, it sometimes display additional text in it, especially for bigger fonts. See screen : Also, if I set width to just 1px less that contentBounds, things are going crazy, containers are moved around, positioned with big margins, etc. How should I solve this? Is it a bug in TLF / Player? Can I fix it somehow? Can I detect the size of the letter, or make containercontroller autosize to fit just one letter only?

    Read the article

  • TLFTextfield broken after upgrading from CS5 to CS5.5

    - by Ashley Muller
    For my project I am using the following: FlashDevelop 3.3.4 RTM Flash Pro CS 5 (libraries only, no code) Some time ago we started using TLFTextfields. One of the things I had to do was include the tlfruntime.swc file from the Adobe Flash CS 5 folder in the FlashDevelop project. Note that I copied this file to the project folder and included it, I didn't just include the file straight from the CS5 path. I have since been given a new computer that has Flash CS 5.5. I recompiled one of my swf libraries in CS 5.5, and now when I run the program, I get: Illegal override of createTextLine in flashx.textLayout.compose.ComposeState I figure the tlfruntime.swc being included in the FlashDevelop project is out of date and needs to be updated with the one from CS 5.5. So I copied the tlfruntime.swc from the CS 5.5 path, include it in the FlashDevelop project (instead of the older file), but now I get this: Illegal override of softKeyboardActivatingHandler in fl.text.container.TLFContainerController. Can anyone assist with what else I need to do to get TLFTextfields working again in CS 5.5?

    Read the article

  • Why does Font.registerFont throw an error the second time a swf is loaded?

    - by Al Brown
    I've found an issue (in flash cs5) when using TLFTextfields and fonts shared at runtime, and I wondered if anyone has a solution. Here's the scenario. Fonts.swf: library for fonts (runtime shared DF4) Popup.swf: popup with a TLFTextfield (with text in it) using a font from Fonts.swf Main.swf : the main swf with a button that loads and unloads Popup.swf (using Loader or SafeLoader give the same results) Nice and simple, Run main.swf, click button and the popup appears with the text. Click the button again to remove the popup. All well and good now click the button again and I get the following error. ArgumentError: Error #1508: The value specified for argument font is invalid. at flash.text::Font$/registerFont() at Popup_fla::MainTimeline()[Popup_fla.MainTimeline::MainTimeline:12] I'm presuming it's happening because the font is already registered (checked when clicking before the load). Does anyone know how to get past this? If you are wondering here's my Main.as package { import fl.controls.Button; import flash.display.Loader; import flash.display.Sprite; import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.MouseEvent; import flash.events.UncaughtErrorEvent; import flash.net.URLRequest; import flash.text.Font; public class Main extends Sprite { public var testPopupBtn:Button; protected var loader:Loader; public function Main() { trace("Main.Main()"); testPopupBtn.label = "open"; testPopupBtn.addEventListener(MouseEvent.CLICK, testClickHandler); } protected function testClickHandler(event:MouseEvent):void { trace("Main.testClickHandler(event)"); if(loader) { testPopupBtn.label = "open"; this.removeChild(loader); //loader.unloadAndStop(); loader = null; }else{ testPopupBtn.label = "close"; trace("Registered Fonts -->"); var fonts:Array = Font.enumerateFonts(false); for each (var font:Font in fonts) { trace("\t",font.fontName, font.fontStyle, font.fontType); } trace("<--"); loader = new Loader(); loader.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler); this.addChild(loader); try{ loader.load(new URLRequest("Popup.swf")); }catch(e:*){ trace(e); } } } private function uncaughtErrorHandler(event:UncaughtErrorEvent):void { trace("Main.uncaughtErrorHandler(event)", event); } } }

    Read the article

  • Flash CS5 font is largest part of the SWF

    - by dev.e.loper
    I'm transferring a project from CS4 to CS5 and (without any changes) my SWF file gets to be 10 times bigger. It was 7kb and now it's 77kb. I generated a size report and it looks like the font is taking up most of the space. I haven't changed settings. I'm not sure why font is taking up so much space. Is there a way around this? Here is my size report: Font Name Bytes Characters ----------------- ---------- ---------- _sans 12 MilkyWell 317 .blsu Calibri-Bold Bold 75960 %.0123456789 As you can see Calibri-Bold is taking up 75kb and I only have 12 characters in it.

    Read the article

  • Flex 4 - Highlight keywords in a block of text using TextLine

    - by Baz
    I have a search and results page that I would like to highlight the keywords that were searched for, in the text of the results. It was suggested that I use TextLine for this, but I am having trouble figuring out how to make it work. I started a simple, compilable dummy application and was hoping someone could give me some tips on how to continue: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" initialize="initApp();"> <fx:Script> import flash.display.Sprite; import flash.text.engine.*; private var textLine:TextLine; private function initApp():void { var normalFormat:ElementFormat = new ElementFormat(null, 12, 0x000000); var highlightFormat:ElementFormat = new ElementFormat(null, 14, 0xff0000); var textBlock:TextBlock = new TextBlock(new TextElement("This is text that has KEYWORDS. I would like to highlight these KEYWORDS by changing their font color and adding a light yellow background graphic.", normalFormat)); textLine = textBlock.createTextLine(); textLine.y = 100; embeddedFontHolder.addChild(textLine); } </fx:Script> <mx:UIComponent width="100%" id="embeddedFontHolder" /> </s:Application> Anyone have any ideas? Cheers, Baz

    Read the article

  • Huge AS 3.0 Export Frame

    - by goorj
    I am creating a very simple flash animation with no code or complex effects, just text and simple tweens (Flash CS5) But I have problems reducing the size of my swf. From the generated size report, it looks like it has to do with fonts and/or exported actionscript classes. The frame with AS 3.0 Classes is over 100K, and even though I am only using one fonts, the same characters are embedded/exported multiple times My questions are: Do embedding of mixed TLF/Classic text (or mixing other text properties, spacing/kerning etc) require the same characters to be embedded twice? Do text transformations on TLF text (rotation and different transformations not available in classic text) require embedding of ("internal") AS3 classes that will increase the size of the .swf? (even though none of these classes are explicitly used by me, there are no scripts in the fla project) I have tried removing all the text instances one by one, and at one point, the swf is reduced to only 5-6K, but I am not able to pinpoint exactly what causes the ballooning of the swf

    Read the article

  • Safari/Chrome problem with ajaxsubmit?

    - by Jan
    Hi I'm currently having some weird issues with ajaxsubmit (http://jquery.malsup.com/form/#ajaxSubmit), which I'm currently using in a project. I have a flow where I need to open a form into a modal window. I'm using fancybox for that and it works like a charm. When the form has been forced to open in the fancybox window there can happen two things. 1) If the user who is about to submit the form is logged in she should see a confirmation in the modal box, that her input was succesfully submitted 2)If the user is not logged in there should be loaded a login form once she hits the submit button 2.1) When the user has logged in she should receive a confirmation in the modal box. This is also working like a charm in Firefox, IE8 and IE7 but not in Safari or Chrome. The weird part is that it seems like safari and chrome are completely ignoring my ajaxsubmit form. To force the first form to be opened I use the follwoing script - this part is working in both Safari and Chrome. $(".klikEnPrisForm").ajaxForm({ success: function(data){ $.fancybox({'content':data}); } }); My ajaxsubmit form scrip looks like this var options = { url: '/?altTemplate=XmlProxyKlikEnPris', dataType: 'xml', data: $(this).serializeArray(), success: function(data) { if ($(data).find('loggetind').text() == 'true') { $("#klikenpris").hide(); $('<div id="fancybox-inner-klik"></div>').appendTo('#fancybox-inner'); $('#fancybox-inner-klik').load('/KlikEnPrisAccept?tilKvittering=1&sagsno=' + $(data).find('sagsnummer').text() + '&pris=' + $(data).find('pris').text() + '&klik-comment=' + $(data).find('kommentar').text() + '&klik-telefon=' + $(data).find('tlf').text() + '&klik-maeglerkontakt=' + $(data).find('maakontakte').text()).stop(true, true); } else { $("#klikenpris").hide(); $("#fancybox-wrap").css({ 'width': '480px', 'height': '220px' }); $("#fancybox-inner").css({ 'width': '460px', 'height': '220px' }); $('<div id="fancybox-inner-klik"></div>').appendTo('#fancybox-inner'); $('#fancybox-inner-klik').load('/login.aspx?loginklikpris=0&klikpris=1&sagsno=' + $(data).find('sagsnummer').text() + '&pris=' + $(data).find('pris').text() + '&klik-comment=' + $(data).find('kommentar').text() + '&klik-telefon=' + $(data).find('tlf').text() + '&klik-maeglerkontakt=' + $(data).find('maakontakte').text()).stop(true, true); } } }; // bind to the form's submit event $('#klikenprisform').submit(function() { // inside event callbacks 'this' is the DOM element so we first // wrap it in a jQuery object and then invoke ajaxSubmit $(this).ajaxSubmit(options); // !!! Important !!! // always return false to prevent standard browser submit and page navigation return false; }); I have tried inserting an alert in the succes callback function but it's never being called it seems. It seems like the default action is not being overruled by the link written in the "url" in ajaxsubmit. I'm really puzzled about this, since it's working nicely in other browsers and I'm completely lost on how I should approach the debugging in safari/chrome. I hope all the above makes sense and I'm looking forward to hear any suggestions. Cheers!

    Read the article

  • Flash automatically names objects on stage "instance#"

    - by meowMIX3R
    Hi, I have 2 TLF text boxes already placed on my main stage. In the property inspector window I give these the instance names: "txt1" and "txt2". I am trying to have a single mouseup event, and figure out which text box it occurred on. My document class has the following code: package { import flash.display.Sprite; import flash.events.KeyboardEvent; public class SingleEvent extends Sprite{ public function SingleEvent() { // constructor code root.addEventListener(KeyboardEvent.KEY_UP, textChanged,false,0,true); } private function textChanged(e:KeyboardEvent){ trace(e.target.name); trace(" " + e.target); switch(e.target){ case txt1: trace("txt1 is active"); break; case txt2: trace("txt2 is active"); break; default: break; } } } } Example output is: instance15 [object Sprite] instance21 [object Sprite] Since the objects are already on the stage, I am not sure how to get flash to recognize them as "txt1" and "txt2" instead of "instance#". I tried setting the .name property, but it had no effect. In the publish settings, I have "Automatically declare stage instances" checked. Also, is it possible to have a single change event for multiple slider components? The following never fires: root.addEventListener(SliderEvent.CHANGE, sliderChanged,false,0,true); Thanks for any tips

    Read the article

1