ActionScript 2.0 :: Set Variable With Quotation Inside?

Aug 17, 2004

I need to set a variable that displays quotation marks on the screen. I don't want to say 30 inches when I mean to say 30".

This is what I'm doing....

inches = "30""

obviously flash thinks I typed two "'s and is giving me a "String literal was not properly terminated" error... did a search with no luck and I can't find anything in flash

View 4 Replies


Similar Posts:


ActionScript 2.0 :: Adding Quotation Marks To Variable?

Feb 19, 2005

I've been trying to add quotation marks to a variable for the past hour or so, but I haven't been having much luck. Basically, here is what I am hoping to create:

Code:
blarg = W71;
temp = magic code that I can't figure out
trace(temp); // displays "W71"

I stumbled on a previous case of this [URL], but that method didn't work for variables when I tried it. Adding a + symbol before and after blarg gave me an error.simple way to incorporate quotation marks around my variable?

View 6 Replies

Replace First Quotation Mark In String?

Aug 3, 2010

[code]...

above im using that regular expression to escape the " in the string. however it only does it for the first "

View 1 Replies

ActionScript 3.0 :: How To Encode A Quotation Mark

Apr 26, 2010

How can I make a quotation mark show up inside a string? [code]

View 2 Replies

ActionScript 3.0 :: Left And Right Quotation Marks In Textfield?

Mar 18, 2009

Is there a way to display left and right quotation marks in a dynamic textfield in flash / as3?

View 3 Replies

ActionScript 2.0 :: Quotation Marks Display As Boxes?

Aug 5, 2010

I have a dynamic text field being populated by an external .txt file:

myData = new LoadVars();
myData.onLoad = function()
{

[code].....

View 7 Replies

Actionscript 3.0 :: Loading XML Text That Has Quotation Marks?

May 27, 2009

i am trying to load text from an XML file to a dynamic textfield inside a flash movie.. if the text written on the XML was something like: this is a text message... then it would work.. but if the text written on the XML was something like: this is a "text" message... then it would return an error...

how can i load XML text that has quotation marks in it to flash?

View 7 Replies

ActionScript 3.0 :: URLRequest Escaping Double Quotation Characters?

Jun 17, 2009

i'm exporting xml from flash to a file on the server as a URLVariables string. When the file arrives on the server every double quotation mark has been escaped invalidating the xml. I suspect the URLRequest class may be doing this.

View 9 Replies

ActionScript 3.0 :: Regex To Replace Straight Quotation Marks

Sep 3, 2009

I'm having problem converting single ' and double " straight quotations to curly quotation marks: � � and � � in a long parsed xml data.

View 2 Replies

ActionScript 2.0 :: @ Sign And Quotation Marks Swapped - Input Text?

Sep 28, 2009

I created a contact form for this Flash site using Actionscipt 2.0 The problem I'm having is that when I try to enter the @ sign (shift+') I get quotation marks and vice versa as if I were using a Mac instead of a PC. This only happens in the contact form and works fine when entered anywhere else such as the address bar or a search engine.

View 1 Replies

How To Use Variable Inside Of Timer

Jun 18, 2010

I'm working on a simple catching game where you have monsters coming out from the corner of the screen and you need to get them with the mouse.What I want to do is change the rate at which the monsters come out depending on the score. The higher the score, the more monsters should come out.The code for creating new monsters is a simple timer event:[code]it works when I declare the variable locally within the function. But then I can't access it outside of it, so it's no good!

View 2 Replies

ActionScript 3.0 :: Use A Variable Inside A GotoAndStop?

Mar 23, 2011

I saw a few examples when googling but couldn't get it to work. I want to use a variable inside a gotoAndStop. Is this possible?
 
[AS]
var vRandomNumber:Number = 1;
gotoAndStop(vRandomNumber);
[/AS]

View 3 Replies

Flex :: CDATA Inside XML Variable?

Oct 23, 2009

In Flex I want to create XML variable like this but parser complains about CDATA in publisher tag:

<mx:Script>
<![CDATA[
private var myXML:XML = <book>[code].....

How do I pass xml text with CDATA into XML variable being in MXML Script?

View 1 Replies

How To Pass Variable From Inside MovieClip Into Another One

Sep 29, 2011

I am creating a quiz and I set one quiz block with questions into a movieclip. When the person answers the correct answer I want it to add to a counter and pass that value onto the next movieclip. So movieclip one is added to the stage it does something then adds a counter. Then moves to the next frame and movieclip2 is added to the stage. It does something and add to the same counter variable from movieclip1. And so on and so on until no more movieclips.

View 1 Replies

ActionScript 3.0 :: Get Variable Name Inside An Array?

Jan 11, 2012

Is there a way to obtain the variable name that is inside an array?[code]...

View 2 Replies

Actionscript 3.0 :: Getting A Variable Inside A Funtion?

Jun 22, 2009

loader_ary[i].contentLoaderInfo.addEventListener(Event.COMPLETE, loadyLoaded);I would like to have access to the variable "i" inside the function loadyLoaded.what code would i need to useto return i or atleast the name of loader_ary[i] and slice it or something.

View 9 Replies

ActionScript 2.0 :: Targeting A Variable Inside A MC?

Jul 7, 2008

I have a movie clip called curtain_mc with this actionscript inside:

[Code]...

I would like to change the variable 'f' from true and false by clicking a button but the actionscript on my keyframe doesn't recognize the actionscript in my movieclip? I know its a targeting issue, but not sure how to alter it in order for the two to talk to each other??

View 6 Replies

ActionScript 3.0 :: Use A Variable Inside AddChild()?

Nov 30, 2009

Here's my (simplified) code:

Code:
var doorType:String = "DT0";
var openType:String = "OT0";
var imagePositioner:Sprite = new Sprite(); //Places a Sprite that will "contain"

[Code]....

openType is defined on a previous screen, it will be equal to OT1 or OT2. I have two sets of images (movie clips) that each have a prefix of "ot1_" or "ot2_" (in their class name). Other than those prefixes the two sets of image names are the same. I think I could cut the amount of code in half if I could use a variable when I use addChild.

I am not very knowledgeable of AS3 and everything I've tried has failed. My theory is that addChild() needs to contain a movieclip, so putting a variable name in addChild() doesn't work.

View 6 Replies

ActionScript 2.0 :: Dynamic Variable Inside Movieclips

Jan 21, 2011

I recently started learning Flash and Actionscript and now I'm trying to write an actionscript for the first time. Im doing this in Actionscript 2.0.I have a movieclip that consists of two images and one dynamic text field with a variable. The name of the images are "VS1_P1_RUN" and "VS1_P1_OFF" and the name of the dynamic text field is "pumptext". In the dynamic text field I have the variable "VS1_P1_Ind". VS1_P1_Ind is probably a boolean variable as it shows 1 or 0 in another program but in Flash it shows True or False (not sure if Flash thinks it's a text/word or a boolean).My script is supposed to display the image named VS1_P1_RUN if the variable of the dynamic text field pumptext shows the text True and it goes like this:[code]

So I'm completely stuck in what to do. The bottom code works as it should but I want the images to show depending on the value of the variable VS1_P1_Ind. I thought just changing the text field to dynamic and typing the variable name in the variable field would do it but no.If it could be a clue to the solution I'll also share that the value of the variable is not seen/shown in textfield while inside the movieclip. Creating a dynamic textfield outside of the movieclip shows the value of the variable just fine, True/False.

View 1 Replies

ActionScript 2.0 :: Load A Variable From The .fla Inside A Function?

Jun 2, 2011

I have some buttons in the scene (inside the .fla) that change a variable "counter" after being clicked. In a separate class there is a function "showPage" that loads a xml-file according to the value of the variable "counter". My problem is, that I dont get the variable "counter" from the fla-file into the function of the .as-class.

Here is my code:

Inside mcMain.as

Code:
class mcMain extends MovieClip
{
//public var counter:Number = 1; //Das hier soll durch den Button getan werden :(

[code]....

View 1 Replies

ActionScript 3.0 :: Creating A Variable Inside A MovieClip?

Aug 5, 2009

I need to create a variable inside a MoveClip. The easiest way to do this is to click on a movieclip in the editor and just enter the actionscript on a frame, but because i'm doing this with dynamically created movieclips i need to do it with actionscript.
 
PS: I'm doing it for sorting purposes in a slideshow.

View 3 Replies

ActionScript 1/2 :: Variable Inside 'for' Loop With Parenthesis

Sep 5, 2009

how Im going to put the i variable inside the [[[[ ]]]]] because I cant make it work for(var i:Number=0;i<products;i++){  _root.menu["product"+i]._x += (product[[[[[+i]]]]]x-_root.menu.product["product"+i]._x)/speed; }

View 5 Replies

ActionScript 3.0 :: Getting Variable Value From Inside Of Event Function

Feb 29, 2012

How to get variable value from inside event function. Variable was declared outside event function.
var StringVar="sample";
myButton.addEventListener(MouseEvent.CLICK, myClickReaction);
function myClickReaction (e:MouseEvent):void{
StringVar="other sample";
} trace(StringVar); /*

It gives me "sample" value and I would get "other sample" value */. That strange because if that would be normal function trace would give me good result.
var StringVar="sample";
function myClickReaction():void{
StringVar="other sample";
} myClickReaction();
trace(StringVar); /* it gives me result as I wanted to have - "other sample" value */

I know also method of passing arguments into event fuction but it not works for me as I would like to
var StringVar="sample";
myButton.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){ myClickReaction(e, StringVar) },false, 0, true);
function myClickReaction (e:MouseEvent, StrVar:String):void{
StrVar="other sample";
} trace(StringVar); /* it also gives me "sample" value and I would get "other sample" value */
How to do that correctly?

View 11 Replies

Flash :: Call Variable Inside A Function ?

Sep 25, 2011

I'm trying to pass a variable through a function, but I'm getting it's value 0. Here's my code:

thumbLoader.addEventListener(MouseEvent.CLICK, goToCategory);
function goToCategory(e:MouseEvent) {
trace(c);[code]....

this trace gives me value of 0. Normally I would do goToCategory(c) and inside that category I would get it's value, but in this case I'm calling this function with an event, how can that be done?

var c is declared globally, so I'm using it above this code in different place... is there smth like global $c like in PHP.. or there's some other way to do it?!

View 2 Replies

ActionScript 3.0 :: Variable/Array Inside A Hit Test

Oct 22, 2009

I have three randomly moving movie clips and one keyboard controlled movie clip which is meant to avoid the tree random flying clips.

I want to do a hit test that basically will do something if anyone of the 3 random clips hit the keyboard controlled clip.

in the hit test i want to be able to have this work for any of the three random clips (flying pumpkins with different instance names, pumpkin1 pumpkin2 pumpkin3). This is all done on an external document class.

I thought about an array but I have no idea really

package{
import flash.display.MovieClip;
import flash.events.*;
import flash.display.*;

[Code].....

View 0 Replies

ActionScript 3.0 :: Access A Variable From Inside A Function?

Dec 8, 2009

i am trying to access a variable from inside a function like this:

ActionScript Code:
var X:Number=1;
function hello(event:event){
trace(X)
}

or something like that... does anyone know why i don't get "1" in the output panel when i run the code?

View 3 Replies

ActionScript 3.0 :: Changing Variable From Inside Of Function?

Jan 9, 2010

I have a code, it is below. And i have two vars: coordx and coordy they both are 0 but when up button is pressed, coordx should change into 1 x remain 0 just like map scrolling and if pressed down it should return to default position, but instead of that variables keeps reseting and it starts from beggining. Here is the code:

ActionScript Code:
var coordx:Number = 0;
var coordy:Number = 0;[code].......

View 3 Replies

ActionScript 2.0 :: Variable Referencing Inside Loops?

Apr 27, 2010

ActionScript Code:
function setUpButtons() {
var btnCnt = numeri_array.length;
for (i=0; i<btnCnt; i++) {

[code]...

i'm having a problem with this script... the onRollOver and onRollOut are working properly but the onRelease it's always the same i mean (my_mc.loadClip(foto[27], "container") for all the 27 buttons..

ActionScript Code:
for (i=0; i<btnCnt; i++) {
var temp = this["a"+i];

[code]....

and everytime i have to make a modify i have to write for every case..

View 2 Replies

ActionScript 3.0 :: Change Variable Inside A Function?

Oct 19, 2010

How can you change a variabele in as3 that you have declared OUTSIDE a function and change it inside the function.My function seems not be able to change the variabele?

ActionScript Code:
function Filter2switch(event:MouseEvent) {
if(filter2 == false){

[code]......

View 1 Replies

ActionScript 2.0 :: Load Outside Variable Inside Movieclip?

Apr 18, 2004

I have a movie clip that needs to load an outside Variable and I know how to do it if the Variable is in the main time line.

Main TimeLine:
timedelay = 5;
MovieClip
timedelay = _root.timedelay

What I can not figure out is how to load a variable in a movie clip that is on the Instance of itself (not in the movie clip).

I am fine if I only use one instance of the movie clip at a time on the stage since I can set the Variable on the Main TimeLine into the movieclip (using .root), but this would not work correctly if I want two instances of a movieclip with differenct variables.

Right now I am having to make duplicate copies of a movie clip with different Variable names. I was hoping there would be some way where I could only use one movie clip and give it different variables.

View 1 Replies







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