When I am loading external UTF-8 text files (or texts from an mySQL DB) with Flash, if those files contains enters (by the user that create them) I noticed that those enters are replaced by two char codes: 10 and 13 (new line feed + carriage return). If I put the loaded string to a TextField.htmlText I get 2 enters pressed, and thus instead of having 1 line change I got 1 paragraph change.
how I could remove anything after a prefix in this string... [URL] so need to end up with [URL] The query string may change so need a way of telling it to remove anything after .flv
ActionScript Code: var string1:String="Jeep Wrangler - Red"; var string1:String="Jeep Liberty - Green"; var string1:String="Jeep Patriot - Yellow"; var string1:String="Jeep Compass - Black";
For each string, I want to create a function that removes the text to the right of the "-" character so the strings return as:
ActionScript Code: var string1:String="Jeep Wrangler "; var string1:String="Jeep Liberty ";[code].....
I have made this converter and it stops working when the user presses enter, as the new line corrupts the data. So i thought, i'll just remove the new lines every time the user presses enter. But apparently i can't access the '' character using string search functions or regular expressions.I try to execute the code in the Change event of input_TF.text
there an easy way of removing all instances of a string from an array?Say i had, [0] forward, [1] forward, [2] right, [3] crash, [4] crash, [5] crash(this structure will change)How would i remove all "crash" instances? the splice method just doesn't cut it =/
I'm creating a fill-in-the-blank quiz in AS 2.0 and would like to make the comparison between the correct and submitted answer a little less harsh during the comparison. The quiz actually consists of memorizing a sentence or two from say a poem and I'd like to not include any errors of punctuation due to a misplaced or missed comma, exclamation pt or period. as long as the spelling is good then the user should get the correct answer. Below is a little snippet:
Basically I'm trying to output the contents of an XML document into a dynamic text field (as loaded - not just its node values and content - the entire thing - into a variable called _root.log). The text field is set to show the variable value of _root.log.This is the actionscript...
PHP Code: var newProfileXML:XML= new XML("<contacts result='true'><contact name='John Doe'/><contact name='Jane Doe'/></contacts>");
I have a very general requirement that seemed very simple: Step 1: Load a new external JPEG image into a MC with a string var encoding a string caption in the URL link (VALUE="../fadeTest.swf?someTextVar=TestCaption") within the EMBED / OBJECT sections. I know how to do this and it semed to work fine. STEP2: When the JPEG is loaded I would like the substituted Text to Fade In over the JPEG. The JPEG should also fade in before the Text. The fade rate should be programmable.
I'm importing text from a .xml file, in that file my text is formatted with HTML and an imported StyleSheet. The problem is... Image The indentation shown here by the red rectangle. I tried to remove it while using text-indent:0; in my css. didn't work..
as you can see by the code I used the "Code snippets" in AS3 and used the "Click to display a text field" in the menu there.
Anyways, it does what I want, however on MOUSE_OUT I want it to no longer display the text there, to not have it visible more than just when the mouse is over the image (bild1) in this case.
This is the code, how should I do this? best easiest solution? would be loads appriciated!
...Or if there's any other easier way to just display a text somewhere on mouse_over and then to not having it visible anymore on mouse_out
"bild1.addEventListener(MouseEvent.MOUSE_OVER, fl_ClickToPosition_5); var fl_TF_5:TextField; var fl_TextToDisplay_5:String = "BMW 335 E92" function fl_ClickToPosition_5(event:MouseEvent):void
I've very new to using Flash with AC3. I've got a small project that reads infomation in from XML files and creates a very two simple menus. The first being the years 2009,2008,2007 etc. (yearMenu_mc). When I click one of these it reads another xml file and builds another menu below (subMenu_mc). This is all working. What I cannot get to work is when I click another year I need it to clear the previous menus text, it just seems to keep over writing and I end up with text that I cannot read anymore. The code I've posted and tried works in one respect it does in fact reset subMenu_mc and I get clear text, but it seems to get rid of the background colour I had set for subMenu_mc.
Code: import scripts.*; Variables var myFont=new fontArial(); var margin:int=2; var link:String; var cWhite=0xFFFFFF; var menuTop:int=-8; /* menu top margin */ var tb:TextField; [Code] .....
I have managed to get rid of unwanted line breaks and returns in the RSS text I am bringing in to populate my dynamic text fields. The Dynamic Text fields are set up not to render text as html, are multiline and have the fonts embedded. I keep seeing things like, <p style=""> at the beginning of the story or <THI.TO> in the middle of the story. Is there any way of deleting anything that appears as <anything> and replace with a space? Here is the code I am currently using to eliminate the line breaks. Also is there any way of turning hyphenation on?
I am looking to have the type to the left of the scroll bar gone, I can't seem to see how it's getting there and how I should get rid of it? (I could also be overlooking a dozen other things I'm sure, but I figure I'd ask here).
I have an input text box for the user to input a name. This box is linked to the variable "name". However when I call up this variable later (by linking "name" to dynamic textboxes), the size color etc. of the font are carried over from the input text box. How would I go about removing this formatting info, so the variable is simply set to the letters typed in by the user?
I have a text field where the user can input their salary, the only problem I have is that if they put a comma in it will break the calculations, so I need to be able to take the amount they give and then rip out the comma and have it just be the full number so I can do the necessary calculations with it.
I have everything working fine otherwise, just need to fix this *hopefully* minor issue.
I am working in Flash 8, but am exporting out with AS 1.0 due to limitations in the base movie file (that I did not build).
i need to do a form composed by a text field and a button.on the press of the button i should output a string that is composed by a default part (ie: http:url...) and by the text inserted in the text form (ie: hello) in order to obtain a string like this one.
Someone has created a map where there are little colored buttons over building locationsThe buttons were made so that when you hover your cursor over them, they will bring up a little chat bubble (like the ones you see in comics) with the appropriate street address text. What I cannot figure out is how to, after removing the cursor from over a button, make the text bubble stay put so that those who see the map can highlight then copy and paste the street address from it.
I am trying to duplicate a text field. First I get the text with a mc.getChildAt(0) and then copy all the contents into a new textfield. The problem I am having is that getChildAt removes the textfield from the movieclip it is in. How to I get the properties of the textfield without moving it? Or maybe it is something else and what I am doing is fine
var dupeTField:MovieClip = duplicateTextField($value.sourceImg.getChildAt(0)); private function duplicateTextField($textField):MovieClip {
I generated some duplicate text fields in actionscript via a for loop and just did the "addChild()" function to add each textbox to the screen. Now I would like to remove them, but how do I do this? Since the textfields all have the same name, I can't do a 'getChildByName()' function to remove them, and I also tried getChildIndex(), but I can't seem to get any of that working.
How do I delete the duplicate dynamic text boxes from the screen via Actionscript?
I am working on a simple textfield(or so i initially thought simple.) that consists of a scroll bar, some dynamically loaded text with a small amount of css styling the hyperlink. There are no initial errors the text loads, the style is applied successfully,scroll bar works BUT the text is no longer organised as all the breaks between the paragraph are gone and the text is squashed together in one block.
I've put my code below.the css is labeled code as there is no cSS tag on this forum
I've been trying to convert and AS2 project to AS3. I've been able to load all the static items from the library and been able to get the buttons to load different text. However when I select a previously clicked button it doesn't remove the old text. here's a section of the code.
ActionScript Code: //Add the FactFind button var factFind_btn:factFind = new factFind(); addChild(factFind_btn);
I have a textfield and a button component.The problem is when the textfield is focused and i click anywhere on the stage it remains focused and no focusout event occurs. I know that it's because component classes implement IFocusManager(Component) interface and the TextField class does not .I do not want to create a new instance of FocusManager class or implement the IFocusManager interface in a custom class. Is there any way to disable the focusmanager ? The deactivate method does not seem to work in as3!
Code: import fl.managers.FocusManager var fm:FocusManager=new FocusManager(this) fm.deactivate()
I'm trying to put the text back into a text field on FOCUS_OUT one character at a time. On FOCUS_IN, I want to remove the text one character at a time.
Here's the basic code: major.text = "ActionScript 3.0"; major.addEventListener(FocusEvent.FOCUS_IN, inFocus); major.addEventListener(FocusEvent.FOCUS_OUT, outFocus); function inFocus(event:FocusEvent):void { major.text="";// want to clear the text one character at a time } function outFocus(event:FocusEvent):void { major.text="ActionScript 3.0"; // want to put the text back in one character at a time }
I attached a fla. that does this in ActionScript 2.0, but I'm trying to do this in ActionScript 3.0.
I am consuming XML which I have no control over. the XML has HTML in it which i am styling and displaying in a HTML text field. I want to remove all the html except the links.
Strip all HTML tags except links is not working for me.
does any one have any tips? regEx?
the following removes tables. var reTable:RegExp = /<tables+[^>]*>.*?</table>/s;
but now i realize i need to keep content that is the tables and I also need the links.