ActionScript 2.0 :: Variable That Includes Other Variables?
Jun 16, 2010
So my problem is when I use this code in php:"&some=var1=aa&var2=bb&&";I would like to receive to flash:trace(myvars.some);var1=aa&var2=bb&But it won't work because flash thinks that always when there is & its new variable.So if I try to trace I get var1=aa
View 0 Replies
Similar Posts:
Feb 18, 2009
How do I create an instance name that includes a variable?
In AS2 I could use:
i = 0;
_this['btn'+i].name = 'btn'+i;
How would i do that in AS3?
View 2 Replies
Feb 18, 2009
I'm trying to create an app that includes 2 clocks. One that displays the user's time (according to their computer) and one that shows the time in a time zone they select from a combobox.For some reason, the user's computer time always works, but the other clock always shows 12 for the hour, and has the correct minutes. The code I have right now is:
ActionScript Code:
time=new Date(); // time object
seconds = time.getSeconds()
[code]....
and the submit button just goes to and plays frame 2.
View 0 Replies
Jan 22, 2012
I have a mobile app where I have 3 states in it. There is the default portrait and landscape and I would to add a third state that includes the other two.
<s:states>
<s:State name="portrait"/>
<s:State name="landscape"/>
[code].....
View 1 Replies
Apr 29, 2008
I'm trying to save the contents of an input text box to a an external .txt file so it can be dynamically loaded back in on another part of the site. I'm using PHP and I have it working however when it saves, the .txt file not only includes the text but a complete set of html formatting tags? How do i get rid of them? The input box (var: editorText) is in a movieCilip (editor) called by the send button with the code:
Code:
on (release) {
editor.loadVariables("save.php","POST");
}
The save.php file is as follows:
Code:
<?php
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");[code]....
View 6 Replies
Mar 1, 2009
I'm trying to create a dynamic text field contained in a button symbol.
I created a box then added text on top of it. I then selected dynamic text, gave it an instance name, and chose all for embedded characters. I select both the box and dynamic text then convert to symbol (button) and give it an instance name.
How do I access the dynamic text I created?
myButton.myDynamicText.text = "test"; ???
View 1 Replies
Sep 16, 2008
I'm using the code below to allow a user to download a file.The problem I am having is that, if the file is located at/images/english/and I say I want to download it to myDocuments instead of having an images saved in MyDocuments /MyDocuments/1.gif.it creates the same folder structure as the file that was downloaded and saves it here:/MyDocuments/images/english/1.jpg.This isn't the whole code, but I think I included all the stuff relating to downloading files
View 1 Replies
Nov 18, 2009
I am writing code in a MovieClip and want to refer to another MovieClip that shares the same parent.it'll be MovieClip(parent).theOtherMovieClip.But I want to refer to the MovieClip using the current MovieClip's instance name + "txt." This was my guess at the code, but it doesn't work.
MovieClip(parent).MovieClip(this.target.name+"txt" )
This didn't work either
MovieClip(parent).this.target.name+"txt"
View 1 Replies
Aug 24, 2004
I need to load an external movie that includes some video. That external movie is like 95mb. How can I preload everything so that there is no lag when I get to the scene where I load the external swf? This movie, of course, is not getting put on the internet. I am using Flash as sort of a high end Powerpoint app. Not sure if this is just a basic preloader or not.
View 2 Replies
Jul 27, 2010
I have an MXML component that includes a .as file with
<fx:Script source="myfile.as" />
Running asdoc throws a whole bunch of errors like
"Error: The private attribute may be used only on class property definitions."
"Error: The public attribute can only be used inside a package."
Solution 1 is to move the AS code into the MXML file. Kind of defeats the objective of using external .as files for MXML components in the first place, so really a last resort option. Code inside a mxml file is messy (I really don't want logic mixed in with mxml), and would also require using the < !--- ---> asdoc syntax.
Solution 2 is to have the MXML component inherit from a normal class file. That would mean no private members in the base class, only internal (meaning a separate package for the component to be safe) or protected. This would make things tedious to say the least.
Are there any other work-arounds or possibly a beta/nightly version of asdoc that fixes the problem? I am using the Flex 4.1.0.16076 SDK, the "latest production quality release".
Update:Just tried using asdoc from the svn trunk, (4.5.0 rev. 16942) and the problem persists.
View 1 Replies
Jul 19, 2009
for (var i=1; i<=arrayCount; i++){
var temp:String = "editremove_mc";
temp += i;
[code].....
View 2 Replies
Aug 3, 2011
Is it possible to store multiple variables of different types inside 1 object. It would be ideal to have a separate property for each variable, but not required. Is there a way to do this?
View 2 Replies
Jan 7, 2010
I'm trying to create a template for a drag and drop question. I want to assign which option belongs to the correct target.Each draggable option is called "drag1, drag2, drag3, etc.". (created on the stage) Each target is called "target1, target2, target3, etc." When a button is clicked, the correct answer is checked using a simple if loop and the user is told which ones are correct.
Code:
if (drag1._y = target1._y) {
//show if correct or incorrect
[code].....
View 1 Replies
Jul 14, 2003
my picture section includes an MC slide show with "next/previous" buttons.
is there any way:
1- to make this MC calls JPG pictures from a directory.
2- make them autofit inside the mask.
View 12 Replies
Jul 27, 2010
I am dynamically creating a bunch of buttons which each toggle their variable on and off, causing corresponding graphics to hide.I also want to have a toggle All on and off button that affects all the variables.I can't seem to get my head around the best approach to turning all the individual variables on/off when I don't really know what those variables will be yet, cause it will depend on how each version of this gets set up.
View 2 Replies
Jan 22, 2009
First of all sorry im not very familiar with the flash lingo, im still new to all this actionscript stuff
ok so i wrote this on a frame in the timeline[code]...
now i need to check which one from all these has a value of zero. then when it finds it i need it to tell me which one it is (s1x or s2x or s3x) so i can do stuff with it.
View 4 Replies
Sep 15, 2009
I just started working on a preloader screen that includes a preloader mask over a logo and a percentage dynamic text. I can get either or to work but not both at the same time. I notice that if I remove stop(); I can get the percentage to work but not the preloader image. With the stop(); embedded the image preloader works but the percentage doesn't.
[Code]....
View 2 Replies
Jul 25, 2009
My current project imports the following on the root time line
[Code]...
I then have a series of movieclips in my library that get loaded in as required at run time using addChild. In each of these movieclips I am having to use the same import commands or I get an error. Is there a way of me changing my code in some way so I only need to use the imports once in the main time line?
View 2 Replies
Dec 3, 2009
I'm trying to cut down the amount of code I type to complete a project. Using things like ?: and &&= over the typical if statements. Is there a way to compare a single variable to a group of variables? example...
var1==var2 || var1==var3 || var1==var4 ? doSomething : doSomethingElse;
is there a short way to check if var1==var2,var3,var4?
View 9 Replies
Mar 2, 2012
I have an embedded image and the class name to be userd in source tag is a combination of 2 variables, how to do this, below is an iadea of what i am trying to do:
[Embed (source="assets/image11_a.jpg")] public static const 11_a:Class;
var first_part:String="11";
var second_part:String="a";
and in mxml
<s:Image width="100" height="100" source="{first_part+second_part}"/>
above is just a small simplified example of what i am trying to do, actually the variables are getting populated from list.Basically i want to combine variable names to form the embedded image class name to be used in source of spark image.
View 1 Replies
Jan 7, 2004
Can I call a variable declared in a SWF, and call the same variable into another SWF, when i am loading it using XML.I am declaring a variable in the "Child movie", and am loading this "Child movie" into a "Parent movie" using XML. Can I retrieve the variable declared in the "Child movie" in the "Parent movie".
View 1 Replies
Nov 23, 2004
I have some code that makes a variable based on an MC's name:
[Code]...
but it doesn't work, yet it traces "_level0.but1menu", and trying the function as this: _level0.but1menu.easeY(100) does work. I've also attached a mock up if you want to see what I mean. al input, this one seems weird to me - but I'm sure there is a completely logical explanation. I've used the same sort of idea to open external swfs with no issue.
View 1 Replies
Nov 7, 2008
I have been using AS2 for a while now but am having some trouble when it comes to the internet side, I basically would like to be able to change the value of a varible on a web page or something and use this value on a different computer, like an mmorpg but it does not have to be that fast, I have looked around and am having trouble working it out, I know you can use servers and stuff but I don't want to have my computer running 24/7 so someone else can use it.
View 1 Replies
Apr 12, 2011
There are 12 color variables, and each answer adds a number to each variable.At the end of the quiz, all the variables are put into an array, and sorted. Then the 3 highest variables are displayed. I have gotten this far. My problem is that I need to link the variable name (color) with the number it returns.[code]
View 2 Replies
Dec 18, 2003
I am using this code to communicate with an easing function:
[AS]
onClipEvent (enterFrame) {_root.gek = false;
for (var i = 0; i<18; i++) {
if (_root.timeline["copy"+i].hitTest(_root._xmouse, _root._ymouse)) { //set gek variable to true when mouse hits timeline[code]....
if "gek" is true then the easing function works and my little "easebar" moves to the mouse.Now, I want to be able to capture what i is when the mouse moves over it so that I can load an mc depending on where the easebar is.I thought I could declare a global variable (_global.j = 0) at the root and then set i to j and use j somewhere else. But i doesn't exist outside of the onClipEvent.
View 8 Replies
Dec 15, 2011
In my flex 3.5 project, I have a class (MyItem) extending Canvas. In this I have declared a private variable named itemInfo which is type of ItemInfo (which is another subclass of Canvas).
I wrote code to hide/show the iteminfo when the mouse is over/out of MyItem. I am not getting any error but it is not showing the itemInfo as expected, when debugged the code, surprisingly the variables tab in debug window does not have the variable itemInfo at all.
I have declared a dummy:int variable and it is also not visible.
View 2 Replies
Mar 16, 2002
If i have an ASP page that is returning variables (and I can see them in the debugger) how do i consentrate a string to call that variable?
ie:
variables being returned are named:
"res1", "res2", "res3"...etc
for (var i = 0; i < 10; i++) {
[Code]...
View 4 Replies
Jan 3, 2006
f you know PHP...then you know that you can create a string variable...and then use the value of that variable to declare another variable. like this:
PHP Code:
<?php$foo = "haha";$i{$foo} = "success";print $i{haha};?>
and it would display "success"...or like this:
PHP Code:
<?php$foo = "haha";$$foo = "success";print $haha;?>
and it would also display "success".
View 6 Replies
Mar 21, 2012
I have an empty SWF that's sole purpose is to call loadMovieNum and start the project. Each loaded movie has a few variables defined within them - unique to those loaded SWFs. Instead of declaring all the variables in each SWF can I declare all of them in one place, in the first frame of the empty loader it all starts from? I'm thinking I can then declare a variable which each loaded movie can increment as needed for me.
View 2 Replies
Aug 20, 2008
How do variables true/false custom variables work in flash?
For example, what I want to do is create a simple true=false variable that I can call on an if statement later.
For example:
Code:
Var1 = true;
if (!Var1)
{
[Code]....
I noticed that neither the "Var1 = true;" part or the if(!Var1) part worked in flash.
View 4 Replies