ActionScript 3.0 :: Rotator Timer - Adding Buttons For User To Control Item
Aug 24, 2009
I have a news rotator that is populated from an RSS feed. The rotator has a timer that cycles through the news items, displaying a link and image and title for each item. I have the put in three buttons for the user to control the item that is displaying. A pause, forward and backward button.
My issue is that I'm not sure how to implement the button without messing up my timer that is already running. I was able to do the Pause button, which was simply to stop the timer. The forward and backward buttons are a bit more tricky. This is what I have so far. Note that I have much of the code duplicated because I needed to initialize the objects for the first timer index. After the first item, the code runs from the timerHandler() function.
PHP Code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
[Code] .....
I want to add a slideshow to a web page. I have made a slide show with flash however I really want to add the play controls. Is this possible using CS4 Flash
If I have several items that move across the screen but the user can click any of them at any time, how do I record the current position of any of the items item in order to use that data to change the position of the item after the user clicks?
This is what I am doing: I have 11 images that slide accross the screen. The user can click any of them at any time. When he clicks one I am scaling the image so it looks like it is comming forward (z axis) and then the rest of the images are scaled down so it looks like they are going back on z axis. So what I am trying to do is get the current position of the image when the user clicks the image so that I can use that to correctly estimate the scaling and moving of the image to make it look like it scales from the center and not from the top left corner. So if have a variable that gets the current position of the image being clicked I'm thinking I can change its position using something like: x = currentposition + -45;
Right now I have a countdown going on, but with a fixed date. How would I go about doing this with a user input?...what I would like to do is the user enter a specific date and the countdown to begin.
I might be a complete newbie at this, but I can't seem to find a tutorial or anything on how to do what I'm trying to do.Ultimately I want to create a countdown for a widget where the user can put in a date and the app will countdown to that date. But the trick is--how do I insert the user variables into the actionscript for the countdown?The script for the countdown is like this:
Code: currentDate = new Date(); thisYear = currentDate.getFullYear();
Is there any way to tell which item a user selects from a List? I already have a "change" event listener, but that doesn't tell me WHICH item was clicked (at least, I don't think it does.)
[edit: forgot the XML part...the list is generated from an xml file:]
I would like to add a timer that keeps track of total time and also current time that runs next to my seek bar component for my flash movie. How can I do this? For example: 1:11 | 2:04 ... the 1:11 displays the current time of the movie and the 2:04 would represent the total time of the video.
I am creating a flash game with a timer and as you answer questions I would like the time to increase or decrease but I can't seem to figure out how to do so.
Is it possible to attach a timer to control a slider? Or alt remove the slider_mc and replace with a timer so that an image desaturated gradually after 60 seconds? Here is the file I am looking at [URL].
I am making a game where I want to have a timer running over each level (a total of 4). When the user has finished the game, I want the timer to stop and then display their time. I have 2 dynamic text boxes with the varibles set to them as "Seconds" and the other as "Min". Here is the ActionScript I have for it right now:
I have an opening screen which asks the user to enter the first name and then they click the "start" button.This then loads an external swf into it and it starts a quiz on a timer.All that works except that the timer starts sometime during opening swf.I'm not sure if it's when the main swf is loaded or if when the user clicks in the input box but it is definitely not when the user clicks the "start" button like I have programmed.I even tried to stop the timer until the user clicks a button on the second swf (the external swf that is loaded into the main swf)[code]In the loaded swf I have a clock_mc that holds the timer.the first frame has a simple stop(); and the second holds all of the code that makes the clock run.I then have code setup so that when the user clicks a button the clock_mc.gotoAndPlay(2)[code]
I need to make a Countdown timer using comboboxes (probably) that, when a user puts in their 17th birthday, can see how long it is until then. I highlight 17 because I want the user to specify the particular year as well as day and month. I would then want a timer that counts down to that particular date!
I'm working on an 8-user app that runs over a wi-fi network using an XML socket. All of the hardware is located inside a medium sized room in a school building.At the start of the app, each user can select 1 role from a pool of 8. However, the socket connection runs at less than realtime, probably because of latency from the wi-fi, so it's possible for two users to make the same selection at the same time. How would I prevent this?
I've been trying to make my own flash game based on the kirupa tutorial: url...My scripting is very similar to the scripting in the tutorial, but I obviously adapted it to my own design. Now Iïż½m trying to add a time limit, which when the time reaches 0 it jumps to the time up screen. I have spent two whole days searching on google, trying loads of suggestions, trying to figure this out myself.[code]This scripting works on a test page (i.e. away from the actual game) but when I try to add it to my game it deletes the main movieclip (in this case a tank) which is used to play the game.
I am actually trying to add user's input name into a sharedobject.
for example: This is code from frame44 and the movie loops back to frame 1 after students input other minor data.
var newstudent:String = NewFishInput.text; var so:SharedObject = SharedObject.getLocal("studentlist"); so.data.name = newstudent; so.flush();
The code that i have is there. However, i can't figure out how do i add additional instance of newstudent after the movie loops back to frame 1 and play til frame 44, prompting another student to add in his name....
I'm doing a drag and drop operation on a tree using some help from Adobe's quick Starts:[URL]
The code suggested is roughly this:
var dropTarget:Tree = Tree(evt.currentTarget); var i:int = dropTarget.calculateDropIndex(evt); myTree.selectedIndex = i;
[Code].....
EDIT: I forgot to post that my current workaround is setting the selectedIndex = -1 after I get my node:XML. I'm afraid that if something bogs on the processor the user may see it select then deselect.
I have a tree control and I want to give the user the ability that he can move up and down the element he just selected with a up and a downbutton. The tree gets generated from XML. I managed to insert the selected item a second time at a other place, with the following code:
var parentXML:XML = XML(containerTree.selectedItem).parent(); var upperItem:XML = topContainer.source[containerTree.selectedIndex-1]; parentXML.insertChildBefore(upperItem,XML(containerTree.selectedItem));
but then I have the item there twice in the List. How can I remove to reinsert it?
I have an exhibitor list that loads from xml...and I have a booth layout that loads from a separate xml...I have two arrays set up so that the rented booths are stored first, and the exhibitors are stored in a separate array side by side... if you click on an exhibitor in the list you will see the associated booth highlight in the mainwindow (and minimap too)...however if you notice, there are multiple entries in the list for some exhibitors, this is because they may rent several booths...I want to condense the exhibitor list to have one entry per exhibitor, but have the entry control all their booths, so if you click an exhibitor with 2 booths both of them would light up even though there was only one entry in the list...is this even possible with the list component provided by flash?
I'm creating an online power hour application. And i need to have a timer to alert the user every sixty seconds for 60 minutes.. Should be simple enough. I'm just having some difficulty.
I am currently trying to create a kind of 'screensaver' effect in one of my Flash movies, and I have the following code which counts down from ten to zero:
The problem I am having is finding the right code to use to RESET this countdown back to ten if the user moves the mouse, clicks a button, presses a keyboard button, etc.
I've looked all over the web and everyone can teach you how to make a timer for your game or a countdown, but I can't seem to find out how to add time to an already counting timer. So here is my counter class:
That works without any issues or problems and just keeps counting upwards at a speed of 100ms, what I want to know is how to add say 30 seconds if something happens in my game, say you kill an enemy for example.
I finally added a timer into my XML AS3 gallery, but when the timer starts the images dislocate..
What is the problem here? I manually set the width and height in the XML with difficulty... (Because I couldn't find a way to automatically set the image to the horizontal and vertical center..)
But why does the position changes when the timer starts to play (every 10 secs)?
This is wat it looks like when the timer hasn't started yet (or when I browse through the images with the arrow buttons):
I made an app (Towers of Hanoi) and i added a "demo" button that solves the problem based on a recursive function. The button is supposed to make a move one step at the time, i mean one step at every few seconds so you can actually see how the algorithm works. The problem is i haven't really used the timer event before and i have no idea how to implement it in this particular scenario.
Code: function hanoiPlay(n:int,a:Stack,c:Stack,b:Stack):void {
I am creating a game and want to reward the player at the end of a level by playing an animation. I have created a timer to add the animation to the stage but cannot figure out how to remove the animation once the timer has completed counting. I am sure you wise scripters out there know the secrete to this mystery.
I'm making a game and it has a 20sec timer in it and I want to make a button/powerup thing that adds 5 seconds to the timer when you press it.I'm currently using: -