Help using multiple if else statements & manual dynamic xml data input to trigger a goto and play.

Below is code that has a timer countdown that reads off of the computer. Below in bold is code to read "if it reaches the date, go to and play frame (2).
timer.removeEventListener(TimerEvent.TIMER, updateTime);
  timer.stop();
  gotoAndPlay(2);
Below is code that is manual input-   I had set up a dynamic txt field in flash named it : raffle_tix_remain When loaded on to the host I can manulally update the xml code and the change will take effect.
raffle_tix_remain.text = root.loaderInfo.parameters.raffle_tix_remain;
My question:  Since the raffle_tix_remain is a manual input from a user to xml  Is there a way to tell flash once it refreshes and "raffle_ tix_ remain"  goes to (0) zero gotoAndPlay(2); and let it play like a "sold out" sign
i guess that would be a  if else statement. 
Code Below-----------------
stop();
var year:Number = 2011;
var month:Number = 12;
var day:Number = 30;
var finalDate:Date = new Date(year,month-1,day);
var timer:Timer = new Timer(100);
timer.addEventListener(TimerEvent.TIMER, updateTime);
timer.start();
function updateTime(e:TimerEvent):void{
          var now:Date = new Date();
          var remainTime:Number = finalDate.getTime() - now.getTime();
          if (remainTime >0) {
                    var secs:Number = Math.floor(remainTime/1000);
                    var mins:Number = Math.floor(secs/60);
                    var hours:Number = Math.floor(mins/60);
                    var days:Number = Math.floor(hours/24);
                    var secsText:String = (secs%60).toString();
                    var minsText:String = (mins%60).toString();
                    var hoursText:String = (hours%24).toString();
                    var daysText:String = days.toString();
                    if (secsText.length < 2) {secsText = "0" + secsText;}
                    if (minsText.length < 2) {minsText = "0" + minsText;}
                    if (hoursText.length < 2) {hoursText = "0" + hoursText;}
                    if (daysText.length < 2) {daysText = "0" + daysText;}
                    day_txt.text = daysText;
                    hour_txt.text = hoursText;
                    min_txt.text = minsText;
                    sec_txt.text = secsText;
          else {
                    timer.removeEventListener(TimerEvent.TIMER, updateTime);
                    timer.stop();
                    gotoAndPlay(2);

stop();
var year:Number = 2011;
var month:Number = 12;
var day:Number = 30;
var finalDate:Date = new Date(year,month-1,day);
  var now:Date = new Date();
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, updateTime);
timer.start();
function updateTime(e:TimerEvent):void{
         var remainTime:Number = finalDate.getTime() - now.getTime()-e.currentCount;
          if (remainTime >0 || raffle_tix_remain==0) {
                    var secs:Number = Math.floor(remainTime/1000);
                    var mins:Number = Math.floor(secs/60);
                    var hours:Number = Math.floor(mins/60);
                    var days:Number = Math.floor(hours/24);
                    var secsText:String = (secs%60).toString();
                    var minsText:String = (mins%60).toString();
                    var hoursText:String = (hours%24).toString();
                    var daysText:String = days.toString();
                    if (secsText.length < 2) {secsText = "0" + secsText;}
                    if (minsText.length < 2) {minsText = "0" + minsText;}
                    if (hoursText.length < 2) {hoursText = "0" + hoursText;}
                    if (daysText.length < 2) {daysText = "0" + daysText;}
                    day_txt.text = daysText;
                    hour_txt.text = hoursText;
                    min_txt.text = minsText;
                    sec_txt.text = secsText;
          else {
                    timer.removeEventListener(TimerEvent.TIMER, updateTime);
                    timer.stop();
                    gotoAndPlay(2);

Similar Messages

  • Looking for a best query for multiple IF Else statement in a single select

    Hi
    I want to run multiple IF Else statements in a single select SQL, each statement is one SQL operating on the same table, what is the best way to write this select SQL query ?
    If it is PL/SQL, when i get the result from the first IF statement I will skip the remaining execution, and so on... Can any one help me on this.
    Thanks in advance !!

    965818 wrote:
    I Apologize, the information i have given might not be enough.
    This is my scenario,
    I am selecting set of rows from the table for the employee id. After selecting those records,
    i need to go through the result list and check the condition 1, if it is met, i will return that employee record.
    If that condition 1 is not met, then i need to go through the condition 2. If that is met, i will return that record.
    Like wise, i have four conditions.
    I am trying to achieve this in a single sql. If i am not clear, please let me know.Not fully clear yet, but the picture is better already. The thing with SQL is that you should stop thinking procedurally. Instead think in data sets.
    For example if the task is:
    Find all managers that work in sales.
    Procedural thinking would work like this:
    pseudo code
    Loop over all employees that work in sales
       for each row
           check if it is a manager
               if manager
                  then return record
               else
                  do nothing
               end
    end loopThinking in datasets will result in a different logic
    pseudo code
    select all employees
    where department = SALES
    and job = MANAGERThis advantage here is that all the "Do nothing" loops are not needed. Those are already eliminated by the database.
    So what is needed to help you? Give the full picture. What is your task that you try to solve. From a business perspective.

  • How can I use an IF ELSE statement and the xdoxslt: get_variable together?

    First of all, I'm a big fan of this forum and I just want to thank the community for helping make the BI Publisher world a better place.
    I'm trying to populate a table with a years worth of data with the column=PRODUCT and row=month of DATE. Here's the catch, not all of the months will have data. So here's where my problem is, I'm not able to use an IF ELSE statement along with a XDOXSLT:GET_VARIABLE expression so that if there's no data for that month the default value will be 0.
    Can someone help me find a solution to either one of the attempts below or a completely new method? Thanks!
    BP4 = numeric month value using DATE (more code to pull only month from DATE not included here)
    JAN1 = PRICE if data exists, else 0
    1) I tried this and it didn't work:
    <?if: xdoxslt:get_variable($_XDOCTX,'BP4'),01 then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    2) I tried this and it didn't work:
    <?xdoxslt:ifelse(xdoxslt:get_variable($_XDOCTX,'BP4')='01',xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE),xdoxslt:set_variable($_XDOCTX, 'JAN1',0))?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    3) I tried this and it didn't work:
    <?xdofx:if xdoxslt:get_variable($_XDOCTX,'BP4')='01' then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    sample XML:
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-01-01T00:00:00.000+08:00</DATE>
    <PRICE>31</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    -DrT
    Edited by: 990965 on Feb 28, 2013 8:27 AM

    let me clarify my logic, the template 1) searches for the relevant PRODUCT (in the case below, it searches for BPD which is the column in the table) 2) searches for the relevant month in DATE (which is the row in the table) 3) if data exists, get PRICE else default to 0
    Variable definitions:
    BP4 = numeric month value from DATE (more code to get this value not included here, but it works...)
    JAN1 = set to PRICE if data exists for that month, else 0
    the query is only pulling all of the existing data, so if there's no data for March then there wouldn't be a March entry in the xml. In the sample xml below, we only have data for the first two months (Jan, Feb) so that's the only data in the xml. I can't check if PRICE is null because the xml will not have any data for March.
    I've read through other threads and it seems that BI Publisher can't use an IF THEN ELSE with the XDOXSLT:GET_VARIABLE. I sent the template and xml to you.
    Sample XML:
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-01-01T00:00:00.000+08:00</DATE>
    <PRICE>31</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-02-01T00:00:00.000+08:00</DATE>
    <PRICE>30</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    Edited by: 990965 on Feb 28, 2013 8:30 AM

  • Help using multiple iphones and ipods on itunes

    Okay, is there any simple way to use multiple apple products thru itunes. I can log in on my account and sync my iphone/ipod, then I log out and log back in with my daughter's account info. I plug her itouch in and it wants to read all of my apps(some apps we both have on our devices). Have problems with music sharing as well. Still a PC user. Get very frustrated with itunes. spend way too much time trying to do things that should be simple. please help! Thank you!

    Are you using method 1 with different windows user accounts?
    http://support.apple.com/kb/HT1495
    Sounds like you are currently using method 2 and not happy with it.

  • I have a question about using multiple ipads in our school.  Each of our teachers have a iPad and AppleTV in their classroom.  The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher

    I have a question about using multiple ipads in our school.  Each of our teachers have a iPad and AppleTV in their classroom.  The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher #1 iPad to its AppleTV without effecting/projecting onto the adjacent teachers #2 classroom AppleTV?

    Not as such.
    Give the AppleTV units unique names and also enable Airplay password in settings with unique passwords for each teacher.
    AC

  • Does 'find your iPhone' use a lot of internet? My mobile data is running out ridiculously fast and I need it to slow down!

    Does 'find your iPhone' use a lot of internet? My mobile data is running out ridiculously fast and I need it to slow down! Anyone has suggestions / info?

    You should shut down all the apps running in the background and then reset your phone.  Double tap the home button to open the multitasking drawer (iOS 6.X) or the multitasking screen (iOS 7.X)  if you are on iOS 6.X press and hold one of the app icons and wait for the icon's to start to jiggle, just like when you want to delete an app.  Tap the little x that appears in the upper corner of the icons.  Repeat until all the icons are gone.
    If you are on iOS 7.X once the multitasking screen is open swipe up on all the app images until they are all closed.  Tap on the home screen to close.
    Then press and hold both the Home and Sleep buttons at the same time and wait for the Apple logo to appear then release both buttons.  The phone will restart itself. 
    If this doesn't help try doing a Reset All Settings reset, you will not lose any data or content or media.  But you will have to reset any setting you turned on or off in Settings.  This will reset all settings back to factory default.  Settings => General => Reset => Reset All Settings.

  • Can I use my ipod touch as a airplay receiver to hook up to my stereo and play my itunes music from my computer?

    I just was wondering, Can I use my ipod touch as a airplay receiver to hook up to my stereo and play my itunes music from my computer?

    I believe there's got to be a way you can use the ipod touch as a airplay receiver to use on the stereo.
    The ipod touch has a port for plugging in earphones, that can also be used to plug a stereo into it.
    Now somebody just has to make an app for using on ipod touch or iphone to plug directly into the stereos input
    jack to play itunes music from your computer wirelessly, other than the ipod being plugged into the stereo with a wire.

  • I have backed up my iPad  using iTunes to windows 8 Lenora laptop but I could not find my files and play video files  in my laptop.

    I have backed up my iPad  using iTunes to windows 8 Lenora laptop but I could not find my files and play video files  in my laptop

    You cannot access files in the backup on your computer.
    Do you mean that you synced with iTunes and transferred your purchased videos and app documents? If that is what you mean, what videos are you talking about? If they are videos that you took with the iPad, they do not sync to iTunes. What files?
    What exactly are you trying to do? Details please.

  • Charactersitic values to be used in IFTHEN ELSE STATEMENT IN QUERY

    scenario: i need to use the characteristic values(not the attributes) to be used in an IF THEN ELSE STATEMENT in query. so i created a formula variable for the characteritic of processing type replacement path, replace with key.The values are not fetched in the result and is displayed as X.
    what should i replace with key,lable, constant or other options whereas  my requirement is the all the values present in the characteristc should be used.
    eg. if char name is xyz and has the values 1,2,3,4,5 till -
    20.
    then in a calculated key figure :(formulavariable =1)* kefig1keyfig2 +not(formulavariable =1)kef2keyfig3.
    this formula variable should have all the values of the characteristic values ie 1,2,3---20.
    2. how should i do get the values of characterstics values in the equation give me the steps in detail..
    3. i do not want to use the attributes, though i tried initally while creating the formual variable i replaced with attribute value, there is was an error and there were no reult.
    i tried to create char. variable  for the characteristic  of manual entr , not ready for input values and gave all the values 1,2,3 --20 as default values and then created formaul variable and repalce with the variable, however this characteristic variable is not at all displayed from the list of variables which will be displayed while creating the formula variable.
    help me out.
    Thanks

    hi srini,
    i have includedthe char in rows. i want you to explain in detail how to use these values in the if then else statement in query.
    i have created a calculated key figure 2= (formual variable =1 & keyfig a =0)* keyfig1kefig2 +not(formual variable =1 & keyfig a =0)keyfig2 *calculated keyfig1.
    so this formula variable of replacement path have ref. to then char. and with what value should it replace, key, name, external char or attribut etc so that i should get the values of the char from 1 to20.
    i donot to repalce with the attribute. i just want the char. values and not thier attributes (1. description 2. the second attribute has the values say abc1,efg2,ghi3 for respective charteristic values.
    ie
    char value               desc                 2nd attrib
    1                            hi                     abc1
    2                            bye                  defg2
    3                            ciao                  ghi3

  • I need help using multiple content types in a wiki page library

    I currently trying to used multiple custom content types based off of the wiki page content type in one wiki page library. 
    EDIT: "Allow management of content types" has been enabled with the designer
    The way i would like this library to work is:
    Click the "Files" tab in the ribbon
    Click the "New Document" drop down menu
    Select one of the content types (Client, Contact, Project)
    SharePoint Will Ask for the Page Name and content type fields
    Click create
    Then it will take you to the new created page.
    This issue I'm currently having is when i click on one of the options (Client, Contact, Project) it will ask for a page name then you have to check it in to get to the edit form. The edit form it then loads is the default content type and not the selected
    content type.
    So my questions are.
    Is there any way i can combine the page name and edit steps together into one step?
    How can I get the edit form to pull from the selected content type?
    Thanks in advanced
    James T.F

    Wiki library isn't really designed for customizations... it's a "special" library that overrides a lot of default behavior... similar evidence can be found if you're trying to add metadata columns to wiki pages... they're just not really designed to handle
    it very well.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • I Want to Select a Date for a Form Field Using a Calendar Instead of Manually entering a date.  Is this possible?

    I want to be able to select a date by clicking on the field and a calendar pops up allowing me to select a date from the calendar that will then populate that field.  Can someone help me accomplish this?

    Thom Parker has a free JavaScript PopUp Calendar here:
    http://www.pdfscripting.com/public/Free-Sample-PDF-Files-with-scripts.cfm

  • XSLT dynamic XML data serverSide. NO External XML file

    I am developing a web application currently using Tomcat 3.2.4, latest Xereces and Xalan.
    I have a JSP page that 1st includes a HTML menu, I then wish to include a JSP page that will produce XML data. I would like to apply an XSLT to this XML data serverSide.. All of the solutions I have seen to date refer to a static XML file.. whereas the data in my XML structure is dynamic..
    If anyone could please lend a hand it would be greatly appretiated.
    Evan.

    Sample code for transforming xmlstring
    public String transformXML(String xmlString, String screenName) {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    StringWriter stw = new StringWriter();
    try {
    //File stylesheet = new File(uc.getXSLName(screenName));
    File stylesheet = null;
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(new InputSource(new StringReader(xmlString)));
    StreamSource stylesource = new StreamSource(stylesheet);
    StreamResult result = new StreamResult(stw);
    result.setWriter(stw);
    DOMSource source = new DOMSource(document);
    // Use a Transformer for output
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(stylesource);
    transformer.transform(source, result);
    return stw.toString();
    catch (Exception e) {
    System.out.println(e);
    return null;
    }

  • HELP ME ! I need to change my credicard data, because my card was stolen and the company give me another. H

    Good Afternoon,
    I live in Brazil and I have an account in Creative Cloud.
    How can I change my credicard data? My card was stolen and I blocked it.
    I have an anual account and I don't know how can i proceed.
    I need help.

    The Email address here in Forum does not have any CC registered to it, please let us know the Adobe ID under which it has been purchased for further assistance.
    Regards
    Rajshree

  • Problem using JRC 2.0 on Unix with xml data source

    Hello,
    I am experimenting difficulties using the JRC 2.0 (which I hadn't with the previous version) on a RedHat 4 machine. It takes 7 minutes (only 20 seconds on Windows) to create a pdf (1 page) from a simple report using an xml file as data source.
    It takes approximately 2 minutes when opening the report
          > reportClientDoc.open(REPORT_NAME, 0);
    then 4 minutes are required to connect the report to the xml data source
          > reportClientDoc.getDatabaseController().setDataSource(xml_ds, "", "");
    Have you got any clue on possible reasons for this issue ?
    Edited by: florian epiard on Jan 30, 2009 4:33 PM

    Hello,
    I am experimenting difficulties using the JRC 2.0 (which I hadn't with the previous version) on a RedHat 4 machine. It takes 7 minutes (only 20 seconds on Windows) to create a pdf (1 page) from a simple report using an xml file as data source.
    It takes approximately 2 minutes when opening the report
          > reportClientDoc.open(REPORT_NAME, 0);
    then 4 minutes are required to connect the report to the xml data source
          > reportClientDoc.getDatabaseController().setDataSource(xml_ds, "", "");
    Have you got any clue on possible reasons for this issue ?
    Edited by: florian epiard on Jan 30, 2009 4:33 PM

  • I need help using multiple internal drives

    I have 3 internal drives and 24GB of Ram on an early 2009 G5. I've recently upgraded one drive to yosemite but my current applications are on the other drive;  running 10.7.5.
    I didn't want to reinstall all the apps on the yosemite drive so I was wondering
    if there is any issue with using one drive for applications and another for work/storage.
    Keeping all my apps on drive running 10.7.5 while everything else is on the Yosemite drive.
    Is it advisable to do? Do the apps run any slower this way?
    Thanks for any help.
    M

    You could add a fourth drive, clone your 10.7.5 system to it, and upgrade the clone to Yosemite. That way you still have your clean Yosemite drive and your working 10.7.5 system in case of trouble with the upgrade.
    In the event that an app needs to be re-authorized when moved to a different drive, do you have a record of the relevant serial numbers?

Maybe you are looking for