ActionScript 2.0 :: Displaying Data From An External File By Pressing A Button?
Jan 10, 2005
just one last actionscript stub. I'm loading text from an external file (a notepad). Now all I want is to be able to change the text by loading text from another external file when a certain button is pressed. Basically, I got this as my default text which loads automatically at the start:
loadText = new LoadVars();
loadText.load("data.txt");
loadText.onLoad = function() {
[code].....
View 1 Replies
Similar Posts:
Jan 10, 2005
I'm loading text from an external file (a notepad). Now all I want is to be able to change the text by loading text from another external file when a certain button is pressed. Basically, I got this as my default text which loads automatically at the start:
loadText = new LoadVars();
loadText.load("data.txt");
loadText.onLoad = function() {
title.text = this.title;
info.text = this.info;
body.text = this.body;
};
But now I want to load text from a different file (data2.txt) by the press of a button. I also have a transition animation so work with me. It would be...
b3.onRelease = function() {
if (_root.section != "photos.swf") {
//I also got this pic (swf) that changes on the button release//
_root.section = "photos.swf";
_root.transition.gotoAndPlay("closing");
So what exactly do I add to be able to change the text source?
View 1 Replies
Feb 13, 2012
displaying an error after saving data to an external file:
var variables:URLVariables;
var fLoader:URLLoader;
var fData:URLRequest;
[Code]....
Where can I post a message to display if the file has been saved or not?
View 3 Replies
May 6, 2009
Actually my requirement is my application consists a button(submit_Btn) when we click on the button(submit_Btn), each time it must to database(through servlet) and brings the data from database and places it on the flash swf file.Here my problem is for the first time when we click on the button it goes to database and place the data(which was returned from database) on the swf file.Next when we click on the button for the second time(or anytime) it is not going and bringing the new data from database(if some data is modified in database or not),Infact it is showing the old data(the data that was collected from previous ClickListener) only on the swf file and it is also not showing any complile time or run time error.
my Code looks like this:
submit_Btn.addEventListener(MouseEvent.CLICK,onCheck2);
function onCheck2(evnt:MouseEvent):void {
var xmlLoader:URLLoader = new URLLoader(); var xmlurl:String =
[Code].....
View 8 Replies
Dec 15, 2011
ive been trying to build a small internet radio player and it works fine besides displaying what current song is playing to some dynamic text we have it set up to upload a plain .txt file to our website every time the song is changed it is displayed for example
Rick Astley - Never Gonna Give You Up
like i said plain text, this is the code i have that displays it, and it HALF works
Code:
myData = new LoadVars();
myData.onLoad = function() {
myText_txt.text = this;
};
myData.load("example.txt");
but the text displays with %20 for spaces and stuff at the end like so:
Rick%20Astley%20%2D%20Never%20Gonna%20Give%20You%2 0Up=&onLoad=%5Btype%20Function%5D
what am i doing wrong?
View 10 Replies
Mar 10, 2008
I have a dynamic text instance in Flash named dynamic_txt and I want it to display information from a php file. What command allows me to do this? Here is the code:
PHP
<?php print "dynamo_txt=DYNAMIC"; ?>
ActionScript (2.0)
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if (success) {
//Here is Where I want the command that will allow Dynamo_TXT to display the String // From the PHP File
};
my_lv.load("cars.php");
View 2 Replies
Jul 11, 2010
I'm tring to import a text file and have a dynamic text field display a random line from that file (picture a quote-of-the-day type scenario). I've been able to import the file, but I have yet to find a way of displaying a random line from the file.
View 8 Replies
Sep 1, 2009
I want to build a flash movie displaying data from an XML file from snow-forecast.com.The file is attached.
I realy do not have enough knowledge of XML.
The file contains data for 6 days forecast.
The structure is All days are in array <periods>
How can i read and parse data in a flash movie for each day? Just give me an example of the first two days _pdayname and the params _pmax _pmin for <max> <min> and <mid>
View 1 Replies
Apr 9, 2007
I will be creating a program to use for data entry. I'll be studying zebras in kenya and I won't have the internet there as I'm recording the data. I'd like to be able to send the data I generate in flash to an external text file. I understand I need some sort of script to do that, but is this something I can run just on my machine? (I'll probably make the data into xml format).
View 1 Replies
Dec 27, 2011
I have two buttons when the user selects both buttons I want to display a movie clip. Basically I created a mouse down event to set a variable name for each button. I also created an on enter frame event that is listening when those two variables are true. When they are true I display a movieclip. how can you press two buttons at the same time and the answer is this is for an air app for ios. So the user can have one finger on one button and another finger on another button when both buttons are selected display something.
I had something along these lines:
Code:
private var _isWinActive:Boolean = false;
private var _item1IsSelected:Boolean = false;
private var _item2IsSelected:Boolean = false;
[Code]....
View 2 Replies
Mar 27, 2010
On to the problem: I have a very simple flash, basically just a photo slideshow. The issue I'm having is this: I have a bunch of photos on the timeline, but I have a button on top of everything, just to give viewers the option to skip that particular scene. The button works, but only when the video timeline has reached the very end of the scene. It won't work before the end of the scene. The button actionscript is the most basic of basic:
on (release) {
gotoAndPlay(scene1)
}
View 2 Replies
Mar 21, 2010
I'm making a Century club timer, it is to execute on pressing the start button, and then run until finished (our paused, but thats not implemented yet). To keep the timer accurate I had to use the Date() function.The timer() function is used to update the displayed time. I tried using a while-loop for this, but then the whole thing would just freeze. :S So instead a use a infinite timer that ends when currentTime == targetTime.
[Code]...
View 4 Replies
Jun 18, 2009
I have a map that I made in flash, complete with up, down, left, right panning, and zoom in and zoom out functions that work by pressing buttons. Is there a script I can slap on the top of these that can make it so when I press and hold down, it continues the action until I release the button?
View 4 Replies
Feb 15, 2005
I have some movieclips containing mp3s, there is one the main movie clip with the background music playing constantly, and several others with short loops that sound only when u click on them....what I need is that when I clic one of the movie clips containing the short loop the MAin movie clip with the BG music to stop automatically..
View 7 Replies
Oct 7, 2010
My data grid is displaying stale data, rather than the real time data available in it's data provider (array collection). I've tried refeshing the data in the collection, but that has no effect. Below is my code, does anyone see what could be the problem?
<mx:Accordion/>
<fx:Script>
<![CDATA[[code].....
View 4 Replies
Aug 31, 2009
How can I set up a button, when clicked puts a string into a newly created swf file which is then saved.
I actually want to attachMovie's to this newly created swf but thought I would start off simple.
View 0 Replies
Aug 11, 2011
I am trying to create a flash movie that allows the user to click a button and then once he clicks down anywhere on the the stage, an image appears. I know this is possible, just not sure what the 2.0 action script is for it.
View 18 Replies
Jul 1, 2009
Is it possible to change one button state, when pressing on another button? E.g.
btn1.onPress = function() {
btn2.setMouseState("Over");
};
The above code does not work though.
View 1 Replies
May 13, 2010
I would like to be able to go from an html page by pressing an enter link then go to a 'preLoader' page which would then automatically load the mainPage. Originally my preLoader was the 'index' page for the site and had a button that would start the loading process to the main site which was entirely a Flash site. But I decided to add an html page chock-a-block with searchable text so people looking for the services this site offered could actually find it and make that the 'index' page. Anyway, I would like the preLoader page to start loading the next page automatically with no user events like mouse or keyboard events needed.
View 1 Replies
Feb 22, 2009
This is a script I have to make a menu appear when you press the "p" button:
ActionScript Code:
onClipEvent (enterFrame) {
if (Key.isDown(80)) {
justPressed = true;
} if (Key.isDown(80) and justPressed == true and _root.openmenu == 0) {
[Code] .....
The problem is that the actionscript wont repeat. I can open the menu once, and can close it once too, but after I close it (move it to x and y values of 1000), it can't be reopened.
View 5 Replies
Sep 3, 2009
I have this project and I wanna when pressing on the button the action is executed just once
coz the action is Executed by the number of times you've pressed on .
here is my project :
[URL]
View 8 Replies
Aug 9, 2011
Is there some way you can stop certain scripts by pressing a button? I tried making a movieclip that you can toggle by pressing the spacebar, but making it pause all the other graphics won't work.
View 1 Replies
Aug 28, 2010
need help with a simple action of pressing a button and a image apears, then you click the image and it disapears,
View 1 Replies
Dec 6, 2005
I made an empty movie clip and named it "container" and then I made a button.. Here's the code for the button in main movie..
on (release){
container.loadMovie("movie1.swf");
movie1.play();
}
Then I put stop(); on the first frame of the swf to be loaded. What I want is to play movie1 by pressing the button in the main movie..
View 5 Replies
Jan 6, 2006
I have recently started a new project, again and hit a stump. Im trying to make a mini game where you have to press two alternating buttons (x and z) to increment the bar. Now i started it, but it failed as pressing any button really fast incremented the bar. i used a _root.onEnterFrame = function() { code, but im having troubles. So what i want to do is have the user press the x button, and then have to press the y button and the bar increases and they have to do this rapidly.
View 4 Replies
Jul 24, 2006
how do i make so that when i press a button instead of juz moving from point A to B, it will move from point A to B then C then D then E. and then i will click again and it will go 5 more steps and so on..? because i tried to write it astargetIndex += 5;but obviously it won't work coz instead of going thru 2, 3, 4, 5... it jumps straight from 1 to 5
View 9 Replies
Jun 20, 2003
How can you switch between scenes by f.e. pressing a button I thought of using loadMovie but then I have several .swf files and I'd like everything in 1 swf file
View 7 Replies
Dec 17, 2009
I am working with xml and a textField. The problem is that when I load another xml text by pressing a button, the old one stays is the textField. They load one on top of the other.
View 1 Replies
Jul 20, 2010
how to embed a value into a dynamically created MovieClip within an external file (.as) that I can access in my .fla file when the MovieClip is clicked.
I have created an external file (.as) that draws a series of adjacent boxes with a number in sequence on top of them. That much works OK, but I want to load it into a Flash file that will do math calculations based on the number of the box.
Here's my .as file.
Code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.text.TextField;
[Code]....
How, for example, can I get the "slide_number.text" box to say something like "The square of this number is ..." and the square of the figure?
View 1 Replies
Dec 11, 2002
(Flash 5) Ok guys, I am trying to get a button to work by pressing keys. Problem 1) I want the keys that are pressed to be ,1,2,3,etc... and those keys aren't in Flash's actions, can they still work? Or do I have to use keys like SPACE, RETURN, etc...??? Problem 2) Here is the code I'm using. I also want a sound to be played while the button is going down. The sound is in the "down" of the button, but I linked it. THe linkage name is "sound1" here is the code;
[Code]...
View 1 Replies