ActionScript 2.0 :: Verify If A Variable Contains A Specific Set Of Characters?

Sep 18, 2003

How do you verify if a variable contains a specific set of characters. Let's say: my_var="My name is Peter and I like apples";

How do I test if my_var contains de word "Peter"?

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Verify If TextFile Exists (Bool Variable)

Dec 1, 2002

Wanted to know if it is possible to make a bool-variable in flash that is set to 'false' by default. It then checks if a file exists at a certain location, and if so, the bool-variable is set to 'true' ?
Something like:
if (c:/myTextfile.txt == true){*do stuff here*;}
What would be the correct code?

View 6 Replies

ActionScript 1/2 :: Input TextField With Specific Embedded Characters?

Feb 21, 2010

I have an input textfield nested inside a movieclip, i embedded a set of characters but when i run the movie i can still input characters that were not part of the embedding list. The input text field has both an instance name and variable name. If i copy that text field into an empty fla file, it works correctly by not allowing character inputs that were not embedded.

View 1 Replies

ActionScript 3.0 :: Prevent Specific Characters From Entering Textfield?

Aug 8, 2011

There is an attribute .restrict but as the defined it only prevents other characters from entering the textfield, restricting the textfield to the given characters. I want to prevent characters 1-10 from entering the textfield. The code below does not work the right way.
 
txt.border = true; //
function down(event:KeyboardEvent):void
{
/*

[Code]....

View 5 Replies

ActionScript 3.0 :: Embed Specific Characters Instead Of Entire Font?

Sep 25, 2009

is there a way to embed certain characters instead of embedded the entire font package which would increase my file size tremendously. I tried creating a textbox and type in the characters I need in hopes that would embed those characters but that didn't work.

View 1 Replies

ActionScript 2.0 :: Creating Font Symbols With Specific Characters?

Jul 16, 2007

For this project I'm working on currently I've had to create a Font Symbol and select 'Bold' in order for the 'Bolded Font' to display in my dynamic text box.I'm just wondering, is there a way to only select uppercase A - Z to be embeded with the Font Symbol, rather than the whole font?Note I had to create the font symbol as this is the only way to attach the 'bolded' version - Else I would be using the 'Embed Font' button and selecting which characters I wanted.

View 3 Replies

Actionscript 3 :: Count Number Of Specific Characters Or Strings In A Txt File?

Apr 3, 2012

If I load a txt file into my flash movie using the following...

var myTextLoader:URLLoader = new URLLoader();
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {

[Code]....

I get my text imported and it splits it every time the letter 'a' is found. That's fine.

How would I go about counting the number of times that 'a' or 'and' (for example) featured in the text?

View 2 Replies

ActionScript 3.0 :: Embed Specific Characters For Font When Embedding Programmatically?

Jul 21, 2010

When embedding fonts programmatically, (example here), is it possible to specify certain characters as you might if embedding within the Flash IDE?Here is my code so far, which simply embeds the font. It works, but I am assuming that it is embedding an entire character set.

Code:

package
{
import flash.display.MovieClip;
import flash.text.AntiAliasType;

[code]....

View 1 Replies

ActionScript 2.0 :: When A Specific Variable Equals A Specific Value A Random Number Decreases On The Current Number?

Feb 20, 2008

i have a project and i need that when a specific variable equals a specific value a random number decreases on the current number, its easy to make it decrease but i need to decrease instead of 4 to decrease a maximun of 5 and minimun of 3.ere is the code :

Code:

numeroDeTazos = 20;
quantidade.text = numeroDeTazos;
if (nrfinal2 == 33)
{

[code]....

View 1 Replies

ActionScript 2.0 :: Add Characters/variable To Instance Name?

May 3, 2008

How do I add characters/variable to Instance Name?

Code:
myColor = new Color(mainMenuButton[NumberFromAVariable]Text);
myColor.setRGB(0xffffff); }

View 3 Replies

Missing Characters From Variable Text File

Oct 26, 2010

I have a text file that contains variables that get pulled into my flash file dynamically.  It leaves out random letters throughout the text when it is displayed in the SWF.I'm at my breaking point and I know I am probably missing something simple at this point.

View 2 Replies

ActionScript 2.0 :: Count Number Of Characters In A Variable?

Jun 12, 2006

Does anyone know, how to count the number of characters in a variable ?[code]...

View 2 Replies

ActionScript 2.0 :: Grab A Certain Number Of Characters, Or Words From A Variable?

Jul 12, 2004

the direction, or throw me some code on how to grab a certain number of characters, or words from a variable

View 4 Replies

Change A Variable Value When In Specific Frames?

Jan 28, 2009

When the value of _root.mc1._currentframe is 10 I want the value of _root.mc2._currentframe to be written (sent or changed) to a variable which I can use in mc1. So I want to be able to use this variable in different clips but I do not want it to be changed until the playhead in mc1 is in frame 10. However I do want the variable to be valid even if the playhead is not in frame 10. This should be so simple.

This is what I have in mc1:

Code: Select allon (press) {
press = true;
if (press == true) {

[Code]....

View 1 Replies

ActionScript 2.0 :: Array - How Variable Returns Specific Value

Nov 19, 2009

I have an array
Code:
var myArray = new Array("James", "Doug", "Alex", "Katie");
Now, based on a text input I'll have, the user will type his/her name. Let's say thew value will be "Alex". How can the variable "Alex" returns me the number 3? I'm trying to make a movie clip jump to an specific frame based on what the user will type. Doable?

View 2 Replies

ActionScript 3.0 :: Search In Variable For Specific Text?

Jul 20, 2010

I don't know how to resolve this very simple action.I've made a program and at this point I've a list on the stage.I want to see if the selected list item has particular value.

Like:
myList.selectedItem.label
(this is current selected item of the list)

here, I want as3 to check if that label has " , " (comma) or not.

Like:
if (myList.selectedItem.label contains == ","){
trace("comma found");

View 4 Replies

ActionScript 3 :: Possible To Have Variable With Specific Class Reference Type?

Feb 14, 2011

Coming from a Delphi background, I am used to be able to have class references/pointers of a specific superclass, example:
#!pas
var
niceVar: class of TClassOne; // Delphi style
badVar: class; // Only? allowed AS3 style to the best of my knowledge
begin
niceVar := x;
badVar := x;
niceVar.staticMethodSpecificToTClassOne;
TClassOne(badVar).staticMethodSpecificToTClassOne;
end;

What this means is that I don't have to cast my variables to a specific class; they are of the correct Class beforehand. This also means that compile-time checking can be performed to make sure proper members are being accessed and I don't have to check that niceVar is in fact of class TClassOne if niceVar was passed to a method.
[Code] .....

So just like a variable storing an object can be for a specific type and only objects of that class or subclasses of it are accepted, so to does "class of AClass" allow for variables of a specific class to be limited to references to a certain class or those inherited from it. I hope that makes sense somehow; I don't know of specific nomenclature for the whole "class of SuperClass" thing. So I'd like to do the same in AS3 as having variables/properties/parameters of type Class does not cut the mustard; its kind of like having all object variables/properties/parameters simply being Object instead of their proper, specific type.

What I'd like to be able to do
public function set recordClass(aRecordClass: TRecordClass): void {
_recordInstance = new aRecordClass(this); // Compiler will know that I am creating a TRecord
}

View 2 Replies

ActionScript 2.0 :: Write To A Global Variable When In Specific Frame

Jan 27, 2009

When the value of _root.mc1._currentframe is 10 I want the value of _root.mc2._currentframe to be written (sent or changed) to a variable which I can use in mc1. So I want to be able to use this variable in different clips but I do not want it to be changed until the playhead in mc1 is in frame 10. However I do want the variable to be valid even if the playhead is not in frame 10.[code]

View 2 Replies

ActionScript 3.0 :: Input A Variable At A Specific Portion Of The Text?

Feb 29, 2012

I have a string of text, but within this text I want to input a variable at a specific portion of the text. Now this string of text is taken from an XML file. So the XML file would look like this for example:

Code:
<name>Sweep</name>
<type>ATK</type>
<target>AoE-EN</target>
<caste>Warrior</caste>
<desc>"This is a text"+temp.alias+"hey"</desc>

The <desc> is an example of a way I tried to make it work. What I want to happen is when I display the desc in my flash file, it inputs the alias (which in the xml is the name) of the item. In PHP this could be doing using EVAL() but I notice the support for that type of function is removed in AS3.

View 10 Replies

ActionScript 3.0 :: Target A Specific Instance Name Based On What A Variable Is Equal To?

Jul 12, 2009

any way to target a specific instance name based on what a variable is equal to? would be ALOT better than having to write the function 36+ times..

View 19 Replies

ActionScript 2.0 :: Verify Swf Has Loaded?

May 7, 2009

How can I verify an swf has loaded, then tell it to do something?

loadMovie("clip.swf", "mcHolder");

View 1 Replies

ActionScript 3.0 :: Best Way To Verify Input

May 11, 2011

I am making a simple tool for use around the office that takes up to maybe up to 8 inputs (text, combo box, t/f, etc)What is the best way to make sure that each field has something entered or selected? I am not worried about malicious code.

View 1 Replies

ActionScript 1/2 :: Handle Special Characters/han Or Chinese Characters?

Aug 17, 2009

I am having issue with my created flash, it can't handle chinese characters? is there some way i can handle this thru code? or should there be any font or language pack installed

View 3 Replies

ActionScript 3.0 :: Each Field In The Form Only Allows 3 Characters And No Special Characters

Aug 23, 2010

1) Each field in the form only allows 3 characters and no special characters such as @ _ ! . , etc... 2) When the user goes to the next field in the form, the previous field appears blank but the when clicking on that again, the original text appears. 3) When submitting the form, it just keeps saying "in progress" and never shows the confirmation text nor does the email get sent. There is an HTML file included with this form but I am not sure if I need to put that in as I have embedded this form into an SWF file so I don't think I need that code but let me know if I am wrong about this. I am posting both the AS code and PHP code below..

[Code]...

View 2 Replies

As3 :: PHP URLEncoding - All Accentuated Characters Are Displayed As Weird Iso Characters

May 30, 2010

My problem is that all my accentuated characters are displayed as weird iso characters. Example :© is displayed %E9 I send a string to my php file :

[Code]...

View 4 Replies

ActionScript 3.0 :: Verify Internet Connection On PC?

Mar 10, 2010

Is there a class in AS3 that will allow you to check if the pc on which the player resides has a current internet connection?

View 1 Replies

Verify If CD In CDROM And Play Projector Otherwise Not

Oct 6, 2010

I am working on a CD project in flash. I have a main Projector(.exe) file which call other swf files. I compile all these files(.exe and swf) to installable CD which copy all the files on the local hard disk and make a shortcut on the desktop.

Now the problem is that I want to run my .exe file only if CD is in CDROM otherwise it loads another swf(from the local hard disk) which shows the message "please insert the CD and restart the application".

View 1 Replies

ActionScript 3.0 :: Verify Some String Is Of Radix

Sep 3, 2009

What I want to do is what parseInt and parseFloat does..basically I want to take ANY string and a radix value from 2->36, and then cut the leading part of the string that makes it a value in that radix.Let's call this method "cutValueFrom( str:String, radix:uint ):String".[code]and yes I could technically bang this out in some long ugly loop... but I want it faster then that. parseInt does it speedy like, I'm looking for something comparable, hence my desire for a good RegularExpressio.

View 2 Replies

ActionScript 2.0 :: Verify If CD In CDROM And Play Projector Otherwise Not?

Oct 6, 2010

I am working on a CD project in flash. I have a main Projector(.exe) file which call other swf files. I compile all these files(.exe and swf) to installable CD which copy all the files on the local hard disk and make a shortcut on the desktop.

Now the problem is that I want to run my .exe file only if CD is in CDROM otherwise it loads another swf(from the local hard disk) which shows the message "please insert the CD and restart the application".

View 2 Replies

ActionScript 3.0 :: Verify Error With SampleDataEvent In Browser

Dec 16, 2011

[AS3]
import flash.events.SampleDataEvent;
var data:SampleDataEvent = new SampleDataEvent(SampleDataEvent.SAMPLE_DATA);
[/AS3]

compile it with Flex 3.6 and run local works, then run in browser, works. compile it with Flex 4.5.1 and run local works, then run in browser, throws exception:

[Code]....

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved