Ask a Question related to Macromedia Flash, Design and Development.
-
c0nF0Rm3r #1
Variables
I am trying to work out how to set up a variable for a timer kind of thing.
My code so far is:
Time = 1;
txtLcd = "time - ", Time;
gotoAndPlay(2);
Time has been declared in an earlier frame (1) and txtLcd is a dynamic
textbox.
How can i get txtLcd to display like "time - 1" where 1 is the value of the
variable Time
TIA
c0nF0Rm3r Guest
-
#39833 [NEW]: Session variables overwritten by local variables (register_globals=off)
From: sup1382 at accedo dot es Operating system: OpenBSD 3.9 PHP version: 5.2.0 PHP Bug Type: Session related Bug... -
#39447 [NEW]: Want to optionally handle apc_upload_progress variables using session variables
From: krudtaa at yahoo dot com Operating system: All PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug... -
Global variables - application variables vs include file
What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include... -
Replacing code based on static variables to variable variables.
Can anyone give me some help or tips in converting this code to take 2 variables that will specify the number of Pack type lines and the number of... -
variables that change session variables
Hi, I'm currently writing a mulit-page form app that uses a session to retain data from each form element in order for the user to jump between... -
Patrik Liljebäck #2
Re: Variables
c0nF0Rm3r wrote:> How can i get txtLcd to display like "time - 1" where 1 is the value of the
> variable Time
txtLcd = "Time - " + Time;
--
Patrik
Patrik Liljebäck Guest
-
Whitecrest #3
Re: Variables
In article <3ef937b6$1@news.iconz.co.nz>, [email]pike@e3.net.nz[/email] says...
txtLcd = "time - " + Time;> I am trying to work out how to set up a variable for a timer kind of thing.
> My code so far is:
>
> Time = 1;
> txtLcd = "time - ", Time;
> gotoAndPlay(2);
>
> Time has been declared in an earlier frame (1) and txtLcd is a dynamic
> textbox.
> How can i get txtLcd to display like "time - 1" where 1 is the value of the
> variable Time
--
Whitecrest Entertainment
[url]www.whitecrestent.com[/url]
Whitecrest Guest
-
Carl Yeksigian #4
Variables
How do you: get the OS variable that you are currently running on
- AND -
the name of the user that is running the application?
Carl Yeksigian Guest
-
nobu.nokada@softhome.net #5
Re: Variables
Hi,
At Wed, 13 Aug 2003 12:57:30 +0900,
Carl Yeksigian wrote:What do you mean by "the OS variable"?> How do you: get the OS variable that you are currently running on
$ ruby -e 'p ENV["USER"]'> the name of the user that is running the application?
"nobu"
$ ruby -e 'p ENV["LOGNAME"]'
"nobu"
$ ruby -retc -e 'p Etc.getlogin'
"nobu"
--
Nobu Nakada
nobu.nokada@softhome.net Guest
-
Brian Candler #6
Re: Variables
On Wed, Aug 13, 2003 at 12:57:30PM +0900, Carl Yeksigian wrote:
Do you mean:> How do you: get the OS variable that you are currently running on
$ ruby -e "p RUBY_PLATFORM"
"i386-freebsd4.8"
(this is the platform the ruby interpreter was compiled under, which may or
may not be the same thing)
Brian Candler Guest
-
Shaun Demellweek #7
Variables
Just a quick question, wondering if someone could answer it for me.
How can you pass variables that users complete in a form to the next page
without them being passed through the address bar?
Cheers
Shaun Demellweek
Shaun Demellweek Guest
-
Pedro #8
Re: Variables
Shaun Demellweek wrote:
If i understand you correctly, just use the POST method for the form>Just a quick question, wondering if someone could answer it for me.
>
>How can you pass variables that users complete in a form to the next page
>without them being passed through the address bar?
<form action="processform.php" method="post">
<!-- ________________________^^^^^^^^^^^^^ -->
User variable: <input type="text" name="uservar" />
<input type="submit" />
</form>
and in processform.php you can access the uservar in the _POST array
<?php
if (isset($_POST['uservar']) && $_POST['uservar'] != 'OK') {
exit('Please type "OK" (without the quotes)');
}
?>
--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.
Pedro Guest
-
Andy Hassall #9
Re: Variables
On Mon, 22 Sep 2003 18:02:49 +0100, "Shaun Demellweek" <shaun@shaund.com>
wrote:
POST form method, or sessions.>Just a quick question, wondering if someone could answer it for me.
>
>How can you pass variables that users complete in a form to the next page
>without them being passed through the address bar?
--
Andy Hassall (andy@andyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
Space: disk usage analysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
Andy Hassall Guest
-
ChrisM #10
variables
i need where "red" is to be a variable, as im creating lots of movieclips, i
have tried and looked on google with no luck, any suggestions?
_root.item.red.textfield.text = "test";
Thanks
Chris
ChrisM Guest
-
Laiverd.COM #11
Re: variables
Don't understand what you're trying to achieve here. Only thing I can say is
that a variable 'red' cannot have a textfield. Maybe elaborate?
John
--
----------------------------------------------------------------------------
-----------------------------------------
RESOURCES
[url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
----------------------------------------------------------------------------
-----------------------------------------
TUTORIALS
Flash & PHP Emailform:
[url]http://home.hccnet.nl/john.mulder/flash/tutorials/flash_php_mailform.zip[/url]
----------------------------------------------------------------------------
-----------------------------------------
Laiverd.COM Guest
-
ChrisM #12
Re: variables
> Don't understand what you're trying to achieve here. Only thing I can
sorry ill try to explain, red was a static name, and textfield was a badly> say is that a variable 'red' cannot have a textfield. Maybe elaborate?
>
> John
chosen example name as its actually dynamic text box, id like to have a
variable or a construct such as "red"+i
like _root.item."red"+i.textname.text = "test"; (but this doesnt work - does
with setProperty for e.g. changing ._x location)
so within a loop it would change red1, red2, red3 and so on all to have the
text value "test"
Thanks
Chris
ChrisM Guest
-
Laiverd.COM #13
Re: variables
Just to be clear on this; red1, red2 etc. have to be movieclips; textname
then can be a dynamic texfield (or -box, whatever). From what I understand
you want to set some text in the textfield of either red1, red2 or etc.
If so then something like
_root.item["red"+i].textname.text = "test";
should work. If i were 2, it would put "test" in the textfield called
textname which is inside the movieclip red2.
If this is not what your looking for then I still don't understand. In what
you have written red1, red2 etc. cannot be the name of a variable.
John
--
----------------------------------------------------------------------------
-----------------------------------------
RESOURCES
[url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
----------------------------------------------------------------------------
-----------------------------------------
TUTORIALS
Flash & PHP Emailform:
[url]http://home.hccnet.nl/john.mulder/flash/tutorials/flash_php_mailform.zip[/url]
----------------------------------------------------------------------------
-----------------------------------------
Laiverd.COM Guest
-
ChrisM #14
Re: variables
> Just to be clear on this; red1, red2 etc. have to be movieclips;
thankyou so much! that is exactly what i had in mind and it works perfectly!> textname then can be a dynamic texfield (or -box, whatever). From
> what I understand you want to set some text in the textfield of
> either red1, red2 or etc.
>
> If so then something like
>
> _root.item["red"+i].textname.text = "test";
>
> should work. If i were 2, it would put "test" in the textfield called
> textname which is inside the movieclip red2.
>
> If this is not what your looking for then I still don't understand.
> In what you have written red1, red2 etc. cannot be the name of a
> variable.
>
> John
Thanks!
Chris
ChrisM Guest
-
Kris Kros #15
Variables
Hi,
I not sure if i am going crazy, but I am having great difficulty passing
simple variables from one .mxml file to another. I have an index.mxml file with
a form. The form has two date fields, a dropdown and 3 radio buttons.
I need to get these parameters to another files called results.mxml. Here is
what I have at the moment but nothing I have tried works! I am trying to get
the radio button text accross first, i reckon once i have this working, it will
be the same for the To and From Dates.
Has anyone any ideas?
Thanks in advance
Chris C
<!-- Here is thew form in index.mxml -->
<mx:Script>
<![CDATA[
function showSelected(event) {
mx.core.Application.application.Results.complaints .text = event;
// this should set the text on the complaints label in results.mxml
}
]]>
</mx:Script>
<mx:Panel title="Search Criteria" >
<mx:VBox>
<mx:Label text="Enter Search Criteria Below"></mx:Label>
<mx:Form id="seachForm" verticalGap="15">
<mx:HBox>
<mx:Label text="Dates:"></mx:Label>
<mx:FormItem label="From" required="true">
<mx:DateField id="fromDate" initialize="restrictFromDate();"/>
</mx:FormItem>
<mx:FormItem label="To" required="true">
<mx:DateField id="toDate" initialize="restrictToDate();"/>
</mx:FormItem>
</mx:HBox>
<mx:HBox>
<mx:Label text="Department:"/>
<mx:ComboBox id="dept_dsc"
dataProvider="{cmsReviewWS.getDeptList.result}" labelField="DEPT_DSC" />
</mx:HBox>
<mx:HBox>
<mx:RadioButton id="showAll" label="Show All"
click="showSelected(event.target.label);"/>
<mx:RadioButton id="showNew" label="Show New"
click="showSelected(event.target.label);"/>
<mx:RadioButton id="showPrev" label="Show Previously Reveived"
click="showSelected(event.target.label);"/>
</mx:HBox>
</mx:Form>
<mx:HBox width="100%" horizontalAlign="right" marginRight="15">
<mx:Button label="Search"
click="{mx.validators.Validator.isStructureValid(t his, 'searchByDateModel'),
validateForm()}"/>
</mx:HBox>
</mx:VBox>
</mx:Panel>
Now on my results page I have a datagrid with some <mx:Label> tags. e.g.
<mx:Label id="complaints" />
<mx:Label text="Date Range: "SelectedFromDate" to "selectedToDate"/>
Kris Kros Guest
-
ntsiii #16
Re: Variables
Forget the variables for a second... How are you displaying results.mxml in
index.mxml?
You are not thinking in HTML are you? You usually want one single
application, and you never "change pages". "Pages" are not really applicable
to Flex ria development.
The easiest way to break an app into multiple files is to create cusotm
components. Your results.mxml file would be an example. Typically, it would
be placed on a container like a ViewStack, or an Accordion, or a tab bar.
There are other options,such as mx:Loader. And if you REALLY want to call a
different page, you can pass values to it.
So exactly where are you now? I can tell you how to handle the variable when
I know.
Tracy
ntsiii Guest
-
Kris Kros #17
Re: Variables
Hi Tracy,
I don't think I explained myself properly in my last post. I have my
Index.mxml file which contains a Viewstack container. Inside this container I
have my custom components like you mentioned. So the first custom component is
my search form and is located at index0 of my viewstack container. The second
custom component is my results, which is a datagrid being populated by a
webservice. I am having trouble passing the variables between the two
conponents.
I hope this is a bit clearer
Thanks for you quick reply
Chris C
Kris Kros Guest
-
ntsiii #18
Re: Variables
Yes, excellent.
In Results.mxml declare a public variable for each value you want to pass.
The way to think of this is that public variables become public properties of
your component. (you can also use getter/setter methods.)
public var toDate:Date;
public var fromDate;
public var complaints:String;
In index.html, in the viewstack code do something like:
<Results id="resultsInstance" toDate="{toDate.selectedDate}"
fromDate="{fromDate.selectedDate .../}"
Note the quotes AND binding braces.
For complaints, do:
function showSelected(sSelected:String) {
resultsInstance.complaints = sSelected;
Tracy
ntsiii Guest
-
ntsiii #19
Re: Variables
There is another option, which is passing a reference to the entire parent
appliation into the component. If you may have many values you need to pass
(we were passing 40+ at one time), this is a much simpler way to do it. The
general idea is the same. The key is to getting the data type correct on the
public property variable.
In Results.mxml:
public var app:Index = null; //the datatype is the name of the application
file name!
In Index:
<Results id="resultsInstance" app="{this}" ...
in this context, "this" is a ref to the application.
In Results, you can now bind to anything in APP, for example:
text="{app.toDate.selectedDate}"
Tracy
ntsiii Guest
-
Kris Kros #20
Re: Variables
Hi Tracy,
First of all, thank you for all your help. I really appreciate the time you
give to this forum. I got my code working passing the variables to the results
screen but i found one or two interesting things along the way. As I said
earlier, I have a viewstack on my index.mxml page which has tree child nodes.
In each child node I have a screen component. The funny thing was, I could only
pass the variables to the results component if I include the search code on the
the index.mxml page. In other words, I could not pass variables from one
component to another. I am not sure if I am explaining myself properly but I
have attached my code so hopefully you will understand what I mean.
I thought that when you included a component, it was the same as if the code
resided on the page that you called it form. Is this the case. If so, I should
be able to include all the code for the search form in another component, e.g.
<screen:oralCompSearhForm>. But when I do this, I get errors.
Any ideas?
Thanks in advance
Chris
Kris Kros Guest



Reply With Quote

