Output Text As Class
Hi I have got all my code working, including this display function, however "totwaste" does not appear in output text... btw i am just using a textfield I have put on the fla manually...and yes I have called it "output" i plan to create the text field dynamically, however it didn't work :p Code: public function display(totwaste:Number) { output.text = "You have wasted this much time..."+totwaste+"."; trace("displaying") trace(totwaste) } thanks for any help
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-01-2007, 10:06 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Getting Runtime Output From A Class
I'm very new to the AS2->AS3 transition, just found out sendAndLoad no longer exists in its easy glory. So I found this template;
Code:
package {
import flash.events.*;
import flash.net.*;
import flash.text.*;
public class SendAndLoadExample {
public function SendAndLoadExample() {}
public function sendData(url:String, _vars:URLVariables):void {
var request:URLRequest = new URLRequest(url);
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
request.data = _vars;
request.method = URLRequestMethod.POST;
loader.addEventListener(Event.COMPLETE, handleComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.load(request);
}
private function handleComplete(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
trace("Par: " + loader.data.par);
trace("Message: " + loader.data.msg);
}
public function onIOError(event:IOErrorEvent):void {
trace("Error loading URL.");
}
}
}
The thing is I cannot load the php-file from the internet to my local swf, thus not being able to see any trace results
I tried to make a TextArea component on the Stage and send the results there, but can't find a method to do so (MovieClip(root).something didn't work).
What would be the best way to view the results without using trace?
[MX2004][Tween Class] Error In Output
i got error message when i type this
import mx.transition.Tween ;
import mx.transition.easing.*;
new Tween(rec_mc,"_x",Elastic.easeOut,0,300,3,true);
Text Input / Text Output...help With Actionscript Required..
hi
I have 2 text input boxes (input1 & input2) and 3 text output boxes ( output1 & output2& output3), also there are 2 buttons to add the text from the input boxes to the text output boxes.
What i need to do is this:
i input text into the 2 text input boxes and when i click the button for input 1 i want it to add the text from input1 to output1,i might then need to add input1 again and i want it to display in output2 as well as output1, then i might need to add input2 and i then want it to display in output3, then again i might want to add them in a totaly different order but always moving to a new output box if the above one is already full.
i hope you understand the gist of what im getting at and your help would be greatfully received.
thanx in advance
Text Box Output
Ok if you check out my chat program at:
http://www.swgfreak.com/k/chat.swf
You will see that any new text entered is added to the bottom. Is there a way to like flip the text box so it pushes text up when new text is added, instead of just going further and further down.
Text Output
Ok, I'm making my first flash mx page, but I can't figure how to make a text output.
I have several text input boxes, but how can I make a txt file out of it?
THX
Text Box Output
I am very new at flash. I want to know how to output a varible in a text box.
so...if my varible =h
i want to show the h in a textbox every loop. I know u have to use a dynamic thingy but it just is not working. I read a tutorial and they put the word mount after the Var term.
How Do You Output Text?
I understand the basic input text command... I just need to know the coding for a button to output/export it into another field...
Thank you
[F8] Can I Trace Output On The Stage Instead Of In The Output Window?
Hi - I'm trying to create a function that divides an inputted number by everything from 1 up to that number. (The aim is to create a .swf movie that will give you the factors of any number you put in.)
I can get the outputs in the output window that I want, but I need now to get them somewhere on the stage itself in a dynamic text box.
This is the script that gives me the correct outputs:
(I have a button named 'ok2' and the input textField is 'Input2')
code:
ok2.onPress = function():Void {
var nInputnumber:String = Input2.text;
for (i=1; i<=Number(nInputnumber); i++) {
var nOutfactors:Array = [];
nOutfactors[i] = (Number(nInputnumber)/i);
trace(nOutfactors[i]);
}
};
What do I need to do to get these to appear onStage instead of in the output panel?
I have tried myDynamictexfield.text = nOutfactors[i], but it will only show the last value for it, not all the ones inbetween.
HELP!!!
Sorry if this is a stupid question - it's the first one i've posted. It's just that if I can't figure this out soon, I may have to throw my laptop at a wall....
Input Text Box Output Help...
Hi FK!
I've got a problem with the old double spacing text in a dynamic text field...
Basically i am sending the content that a user types into an access database using ASP, but i need to know what the input text box sends when the user hits the enter key...? and hopefully a little advice on replacing this with a break tag (ie. whether i should replace it in actionscript or in the asp file)
Thanks in advance
Text Input Output
Hi guys.
Trying to have one scene ask user for input data(e.g. name) so that I can output the data in a later scene.
Text Output Bugging Me.
Argh, really bugging me.
I have a dynamic text box get info from a txt file. It reads it fine except it won't show the "%" sign! I'm sure this has to do with ascii and it might not be showing other symobls but what do i have to do to make the dynamic text box able to display "%"?
I hope the solution isn't to have to write the ascii code for each time i want to use it...
Text Output In Flash 5
Hi everyone,
I have a problem. I'm trying to output some text from my Flash application to a simple text file, but the only thing I could find that does such a thing is:
Code:
fscommand("save", "save.txt");
This outputs more than what I want: it is all of the variables in the _root, with &s between each variable and their value.
What I want to do is save just the _values_ to a text file in whatever order I want.
Can anybody help me?
Thanks,
... Mike. ^_^
Output To Text File
I've done some reasearch, and I found out that Macromedia took out the FSCommand:save function (I was using it in Flash 5) in Flash MX.
I am now using Flash MX for my project because I need a timer, etc., to wait for my external program to run.
So, my question is, is there _no_ way at all to output specific text (even if it's all of the variables in my project, I don't care!) to a text file?
I absolutely need to be able to export some variables in my Flash project so that my C++ program can read them in... can anybody help me, or know of another way to get my Flash variables into my VC++ app?
... Mike.
Output To Text File
I've done some reasearch, and I found out that Macromedia took out the FSCommand:save function (I was using it in Flash 5) in Flash MX.
I am now using Flash MX for my project because I need a timer, etc., to wait for my external program to run.
So, my question is, is there _no_ way at all to output specific text (even if it's all of the variables in my project, I don't care!) to a text file?
I absolutely need to be able to export some variables in my Flash project so that my C++ program can read them in... can anybody help me, or know of another way to get my Flash variables into my VC++ app?
... Mike.
Input/Output Text
Hello there.
This is my first times to the forums so if this question is not for this thread, please direct me to the right one.
I am developing a faux-MSN window where when I type in the input boxt, it comes out in the large screen. Is there a tutorial I can find somehwere that can show me the actionscript to do this?
IE" When I type "hello my name is James"
The output on the above window comes up as "James Says: hello my name is James"
Output Text To A .txt File
Hello,
I was wondering if there is any way to output strings (or Variables) to text files. Any help would be appreciated... Thanks :)
Refreshing Text Box Output
Alright. I've made a tool in flash that calculates the value of money in comparison to the value of goods avaliable. however, the values that my program is supposed to calculate wont update when variables are changed, how do i fix this?
here is my code, commented for ease of reading:
Code:
/* Declares amtGood */
var amtGood:Number = 10;
/* Adds 1 to amtGood */
produce1.onRelease = function() {
amtGood += 1;
trace(amtGood);
};
/* adds 10 to amtGood */
produce10.onRelease = function() {
amtGood += 10;
trace(amtGood);
};
/* adds 50 to amtGood */
produce50.onRelease = function() {
amtGood += 50;
trace(amtGood);
};
/* Declares amtMon */
var amtMon:Number = 10;
/* Adds 1 to amtMon */
print1.onRelease = function() {
amtMon += 1;
trace(amtMon);
};
/* Adds 10 to amtMon */
print10.onRelease = function() {
amtMon += 10;
trace(amtMon);
};
/* Adds 50 to amtMon */
print50.onRelease = function() {
amtMon += 50;
trace(amtMon);
};
/* Declares valGood */
var valGood:Number = amtMon / amtGood;
As a brief explanation, I have 4 sets of buttons (the code for the first two sets is in there), They Create goods that are used to back paper currency (amtGood and amtMon are the amount of goods and money). To calculate the dollar value of goods, the total money is devided by the total amount of goods. However it won't calculate anything but the original 10/10
Random Xml Text Output
Hi does anyone know how to output a random xml node, for example:
<greeting>
<greet>Happy Christmas</greet>
<greet>Happy New Year</greet>
<greet>Hi from the team</greet>
</greeting>
Basically a random message would be displayed in the scene and shown when called, for example an animation will play, and a message will be shown, the next time the animation is show the message is shown again, only this time different.
Any ideas or approaches, in a simple learning curve way for the quick addition?
Any advice, direction examples better still would be perfect.
Many thanks
Refreshing Text Box Output
Alright. I've made a tool in flash that calculates the value of money in comparison to the value of goods avaliable. however, the values that my program is supposed to calculate wont update when variables are changed, how do i fix this?
here is my code, commented for ease of reading:
Code:
/* Declares amtGood */
var amtGood:Number = 10;
/* Adds 1 to amtGood */
produce1.onRelease = function() {
amtGood += 1;
trace(amtGood);
};
/* adds 10 to amtGood */
produce10.onRelease = function() {
amtGood += 10;
trace(amtGood);
};
/* adds 50 to amtGood */
produce50.onRelease = function() {
amtGood += 50;
trace(amtGood);
};
/* Declares amtMon */
var amtMon:Number = 10;
/* Adds 1 to amtMon */
print1.onRelease = function() {
amtMon += 1;
trace(amtMon);
};
/* Adds 10 to amtMon */
print10.onRelease = function() {
amtMon += 10;
trace(amtMon);
};
/* Adds 50 to amtMon */
print50.onRelease = function() {
amtMon += 50;
trace(amtMon);
};
/* Declares valGood */
var valGood:Number = amtMon / amtGood;
As a brief explanation, I have 4 sets of buttons (the code for the first two sets is in there), They Create goods that are used to back paper currency (amtGood and amtMon are the amount of goods and money). To calculate the dollar value of goods, the total money is devided by the total amount of goods. However it won't calculate anything but the original 10/10
Fancy Text Output
Does anyone know how to produce a text output going left to right, one letter at a time like the Flash animation in http://www.exploremarsnow.org/? Thanks
Output To A Text File
I want to be able to output variables from a Flash movie and save them into a txt file. I know flash can not do this directly but I was wondering if there was a way of using a server-side programming lanuage (like ASP, Perl ect.) to handle the file writing. Can this be done? If so can anyone point me to a tutorial that would help or give me some code that will do this?
Thanks
Andrew
Text Output With Accelration?
Last edited by scottmalo : 2003-03-23 at 17:12.
Hmmm edited my previous post:
Im outputing words selected from and array to a dynamic text field.
1. search array for firstWord
2. search array for secondWord
3. cycle from the firstWord to the secondWord, and outputing to a text field each word between the two.
This i managed to write up no probs.
My question is, how might i apply a little acceleration to this, speeding up the cycle of words as i get closer to the secondWord (end).
I know how to apply easing and such to MC's that might be moved along an x/y axis but what about executing a series of commands with aceleration?
anyone? or am i just not clear?
Issue With Text Output
I've got a little issue to display some text in a dynamic text box.Thix text box is outside the button(s) in another layer.
The matter being:
if i don't put : _root.onEnterFrame = function() {
menu = "Select a category";
i get a weird text ouputed : "Object 0" or something but then when i roll over my buttons, the text "category 1 or 2" are ouputed correctly
Now if i put (like i did) the code above i don't get Object 0 (blabla) outputed but i can't see the text for the buttons.
I think i need a "clear previous text" or something not sure to get this working smoothly..
Thanks for your help, below the full code
Code:
_root.onEnterFrame = function() {
menu = "Select a category";
}
_root.icon1.onEnterFrame = function() {
if (mouse_over_icon1) {
_root.icon1.nextFrame();
menu = "category 1";
} else {
_root.icon1.prevFrame();
}
};
_root.icon2.onEnterFrame = function() {
if (mouse_over_icon2) {
_root.icon2.nextFrame();
menu = "category 2";
} else {
_root.icon2.prevFrame();
}
};
Input And Output Text Problem
Hello Guys, how is everybody. I'm afraid I need to pick some brains! I've worked out how to input text from a .txt file but I haven't worked out how to put it in there from the swf. Can anyone help. What I am trying to do is a sort of note pad which can be stored and retrieved when needed. So the person writes into a text box presses save, the text goes into a txt. file and then is retrieved later by a loadvariable function. Does anyone know how to do this?
Please help.
Thank you.
Crusty.
Create A Text Field Output
I am using flash 4 and following an excerpt from flash 4 bible- its telling me to create a Text Field variable called "percentageOutput"
I do not see Text Field Variable as one of my options under frame properties > actions tab. What am I missing?
Thanks!
CRO8
Output Array To Text File
This seems like it should be really basic, but is there any way to output an array created in flash to a file that can be read by an external script?
I am using flash 5.0. I have checkboxes generating boolean values that that are then organized into an array, and I have a script that will parse through that data and use it to do great things. The only problem is that I do not know how to access the array that I am creating. Any information someone can offer will be so helpful. I am left with this feeling that the answer is painfully, painfully simple.
thanks,
J
PHP Output In Flash Text Window
Hi,
I have searched the net and forum but was unable to find s "simple" solution to a problem.
Situation:
I have a php file which reads and displays data from database.
It just puts out the data with echo string.
PHP (novice.php):
PHP Code:
<?
require("novice/newsadmin-functions.php");
print_news(5);
?>
This calls the function which displays last 5 news.
So basicaly how would I include that output into Flash?
Like in simple text box (with scroll bars) or anykind?
Thank you for your help!
Regards,
Futzy
How To Round Off Numbers In Output Text Box?
Hi,
I have 2 input boxes and an output box. The output is a simple division of the inputs. I used the following code. I want to round off the answer in the output box. I understand that Flash has a roundedNum = Math.Round() option..but I do not know how to use this with my code...Please help me...Shud I change my code?
on(press){
_parent.c1.text = Number(_parent.a1.text) * Number(_parent.a2.text);
}
where c1 is my output number and a1 and a2 are my inputs.....
Thanks alot.
How Do U Create Buttons That Output Text?
Hey im new to this site and relatively new to actionscript and am seriously struggling on tryin to create buttons which will output text. For example create an "A" button that when u press makes an "A" appear on a text field. I am trying to make an interactive keyboard on Flash 8 and its just not happening!! pleaaaaase if anyone knows how to do it, could u let me know asap...thanx!
AS3 Loader With Basic Text Output
OK, AS3 is making me feel stupid. I want to create a basic preloader that just outputs the percent of an external swf loaded until the movie shows up on stage.
Here is the current loader site:
http://www.oberlander.us/coolcar.htm
It loads a load.swf which then loads coolcar.swf (AS2)
The only code in the load.swf is the following Document Class.
For some reason, the TextField pops up with 100% immediately.
What am I missing?
ActionScript Code:
package
{
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
import flash.text.TextField;
public class MovieLoader extends Sprite
{
private var _loader:Loader
private var movieLoaded:Boolean = false;
private var textOut_txt:TextField = new TextField();
public function MovieLoader()
{
_loader = new Loader();
addChild(_loader)
addChild(textOut_txt);
textOut_txt.x = 200;
addEventListener(Event.ENTER_FRAME, checkInit);
_loader.load( new URLRequest("coolcar.swf"));
}
private function checkInit(event:Event)
{
var loaded:Number = _loader.loaderInfo.bytesLoaded
var total:Number = _loader.loaderInfo.bytesTotal
var percent:Number = loaded/total;
UpdateProgress(percent);
if(loaded >= total){
removeEventListener(Event.ENTER_FRAME, checkInit);
}
}
private function UpdateProgress(prog:Number):void
{
textOut_txt.text = String(Math.floor(prog * 100)+"%");
}
}
}
Redirect Trace() Output To A Text Box
I have a flash app that works fine in local testing, but fails to load dynamic data when live on a site if I use the javascript method to get around the "click to activate issue"
What I would like to do is to direct all the trace output to a textbox so I can test it in situ. Is this possible in AS2? I know there is the import flash.util.trace for AS3, but I use XP64 so AS3 won't install as it tells me I dont have XP.
I am basically looking for an onTrace type event. I know it's a long shot :)
many thanks,
ben.
How To Output Actionscript At Runtime In A Text Box
Hi , i need help in displaying my code at run time, I need to dispaly my code in a text box when the program runs.
I guess something to start would be output_txt.text. then i need to call my own action script. but not sure how...
Attach Code
output_textAutionScipt.text = "arhh";
Preloader And Dynamic Text Output
Hey folks,
I'm working with a larger-than-usual Flash file that cannot be broken into smaller elements, and in trying to keep the lowest common denominator audience in mind, I was trying to get a dynamic text field to display text base on the progress of the load, if anything just to give them something to read other than the percentage number increasing. What I tried below didn't work (as most of my experiments tend to do). What am I missing? Thanks!
Attach Code
stop();
this.addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event):void {
var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;
mcBar.scaleX = loaded/total;
txtLoaded.text = Math.floor((loaded/total)*100)+ "%";
if (loaded < 25) {
txtLoadMsg.text = "Part 1 text here";
}
if (loaded >= 26 && loaded <= 50) {
txtLoadMsg.text = "Part 2 text here";
}
if (loaded >= 51 && loaded <= 75) {
txtLoadMsg.text = "Part 3 text here";
}
if (loaded == 80) {
txtLoadMsg.text = "Part 4 text here";
}
if (total == loaded) {
play();
this.removeEventListener(Event.ENTER_FRAME, loading);
}
}
Input/output Of Text Files
Hi - can anyone pass along instructions for writing a text file - ie. the content of a variable (array) to a text file for retrieval at a later time?
Thanks!
Help...input/output Text In Flash 8
hi all. i'm currently creating an animation for my Multimedia Industry Certificate III course.
i've created an input text box where the user enters their name into it to begin the animation. i've created the output text box which works and all the text shows up, but the only problem is that it appears broken apart and isnt in a continuous sentence which is what i would like it to do.
the coding i've used for the frame is:
enter.onRelease = function() {
gotoAndStop(2);
output = input;
output = "Hi "+input+". There's a treasure map somewhere in the living room that leads to buried treasure. Let's go find it!";
};
and the output text box in the animation looks like this:
can anybody help me with coding or anything to make it appear in the one line instead of the break after Bob. It would be much appreciated!!!!!!!
Ev
Input/output Of Text Files
Hi - can anyone pass along instructions for writing a text file - ie. the content of a variable (array) to a text file for retrieval at a later time?
Thanks!
Fading Text Output Problem
Did some fading text, looks great on the stage, but publish test or publish it doesn't work. Made sure that browser has latest Flash installed.
Searched and found that this is a commom problem with no good answer.
Any ideas why it would not work?
Chopped Text In Output Window
hey peoples, i just got myself an ibook and i'm running flash mx onnit. for some very strange reason, all traces output only the top half of each line. weird. resizing the window and highliting the text and closing and opening don't help.
anyone have any clue?
thx
-depth
Flash MX: Output To Text File
I've done some reasearch, and I found out that Macromedia took out the FSCommand:save function (I was using it in Flash 5) in Flash MX.
I am now using Flash MX for my project because I need a timer, etc., to wait for my external program to run.
So, my question is, is there _no_ way at all to output specific text (even if it's all of the variables in my project, I don't care!) to a text file?
I absolutely need to be able to export some variables in my Flash project so that my C++ program can read them in... can anybody help me, or know of another way to get my Flash variables into my VC++ app?
... Mike.
Number Input To Text Output
Newbie, I am. Very.
Have been messing with this as part of a school project:
(oops, can't post URL)
I've tried many approaches now, and apparently
none that are correct : ) Your insight would be
greatly appreciated!
I've created an input/output box where the user types
in their average hours on a computer and online per
day, and one output calculates total hours per week
(this part is working) a second output is intended to
be text categorizing them as a "non-user" "moderate
user" or "heavy user". This second type of output
exists for the two inputs (computer hours and hours
spent online). In each case, my text output simply
says "NAN" (in past attempts) or "type function" error
(current problem).
My code for the two sets of input/out fields:
//contained in the first frame of input1 layer
submit_btn.onRelease = function(){
output1 = 7*input1;
}
function text_output3(text:String){
if(output1 >= 14){
display.text == "you are a heavy user";
}
else if(output1 < 14){
display.text == "you are a moderate user";
}
}
//contained in the first frame of input2 layer
submit_btn2.onRelease = function(){
output2 = 7*input2;
}
function text_output4(text:String){
if(output2 > 35){
trace("you are a non-user");
display.text_output4=="you are a non-user";
}
else if(output2 < 60){
trace("you are a moderate user");
display.text_output4=="you are a moderate user";
}
else if(output2 >= 61){
trace("you are a heavy user");
display.text_output4=="you are a heavy user";
}
}
show.text_output4.text;
merci, merci...
Can Flash Create An Output Text Or Jpg File?
Is it possible to create an output text or jpg (or any other type) of file in a Flash application? Example: I would like to create a Flash-based paint program that allows a user to paint whatever colors and shapes they want on a digital canvas. Ideally when they're finished, they could click a "save as jpg" button or "save as bmp" button or even "save as Word document" and the image they just created is saved in the file format of their choice.
Thanks in advance.
Flash Output To Simple Text File
I'm using flash 5, and I was wondering, how can I extract values of variables in a flash movie to an ordinary text file. I hope you guys can help.
Print & Output Text File From Variable?
Im using flash to create dynamic graphs etc, the graphs will be generated by variables inputted by the user.
The aim of the project is for job level assesment.
On each page the user has space to type in any comments (things they need to improve on etc). I need to be able to gather the contents from these text boxes and be able to print a sheet which would have them all listed one after the other with a return between each.
I might also need to have the option to save the data as a text file to their computer (the clients not sure about this yet) .
Any comments on the best ways to go about any of these would be greatly appreciated
The final project will be outputed as a projector and run off of a cd, so preferable any scripts that might me used would need to be run off of the cd (if this is possible)
Cheers
Ian
Output The Contents Of A Text File From A URL Via Flash
Hello, I am trying to output the contents of a text file from a URL via flash. I need to download a document, parse it, then insert its value into a text input box periodically.
Is there an easy way of doing this as I've been stuck on it for ages....
Any ideas would be most appreciated!
Cheers
Rob
Loading External Text - Strange Output?
this is the code im using (within on load of the text area) to load external text into a textarea:
on (load) {
thisText = new LoadVars();
thisText.load("main.htm");
thisText.onLoad = function(success) {
if (success) {
text = thisText;
}
};
}
the text area is set to render as html (html = true).
When the text loads into the text area it displays like this:
%3CP%3E%3CB%3EThis%20is%20bold%20text%3C%2FB%3E%20 %2D%20this%20is%20regular%20text%3C%2FP%3E=&onLoad =%5Btype%20Function%5D
When really the external text contains this:
<P><B>This is bold text</B> - this is regular text</P>
does anybody know how this occurs?
or a solution to this problem?
Cheers,
David
Dynamic Text Box Input Which Shows An Output?
Hey guys,
I have a uni project where on the first page there is a text box where you have to enter your name.
Then on the next page I want the name entered to show on the page.
How do I do this. Does anybody have a mini fla. file they can email me with it?
b18269@hotmail.com
Is doing my head in as the work must be in 2moz morning.
Any help welcome
Thanks guys.
|