Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Adding Dynamic Text Box Values - NaN


Hi all,
I have a movie that contains a series of radio button groups, which each have their own accompanying dyn text box.
When a certain radio button is selected, a pre-determined value is loaded into each respective groups' text box, via "onRelease".

Now, I can get these values to appear fine in each text box, but I then have a fourth text box (amount_total), into which I want to have the sum of all the previous text box's values.

I have a submit button with the following actions on the first frame of the timeline:

onSubmit = function (){
_root.amount_total = Number(_root.total_surf) + Number(_root.total_music) + Number(_root.total_video);
}

Now, when I hit the submit button NaN is returned.
Any ideas as to what the possible issue is here ?
FLA posted

Cheers
D




KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 09-02-2005, 10:36 AM


View Complete Forum Thread with Replies

Sponsored Links:

[Flash8] - Dynamic Text Box And Adding Values
Hello all:

First post and I'm hoping that somebody can help me out. I'm not a programmer but have been using Flash for awhile. This is my first heavy dive into variables.

I'm putting together a Quiz game where I pull the information from a txt file. I can get everything to display and work fine except for the adding of a total score.

Here is the gist:

I have a series of values in a text file and load it into my movie. Depending upon what button I push, I want to take the value and add it to the total score. The next button I push I want it to add that value to the new total score.

I've enclosed a file for reference. Any help would be great appreciated.


Ski

View Replies !    View Related
Adding The Values Of 3 Dynamic Text Boxes
I have 3 dynamic text boxes on the main movies stage that are getting their values from an externally loaded swf. If statements within the external movie loads the values from an xml file depending on which action is selected by the user. Now I have a fourth text box that needs to gather all the values that are loaded in the other 3 and add them together...placing zero if nothing is loaded. I have done various code tests...I get either NAN or _level0.total ...total is the instance name of one of the boxes, I am trying to access. Anyone know what I am doing wrong or where to turn to figure it out.

any help would be appreciated

thanks

View Replies !    View Related
.text Values Not Adding Correctly
Im trying to take two seperate text boxes with a numeric value and have a third text box equal the value of the first two added together.
Currently what its doing is

firstBox.text = 14
secondBox.text = 3

totalBox = 143

I need it to add 14 and 3 to get 17.
Its placing 3 as text to the end of 14?

My AS looked like this

totalBox.text = firstBox + secondBox

So im totaly lost and cant figure it out. Any help would be appreciated.

View Replies !    View Related
Adding Values From Text Input Components
I'm trying to get the values from 5 text input components into a total box without using a 'total' button. I'm using onClipEvent (mouseDown), and the total box's text is returning 'NaN'. Any suggestions? Please see attached file.
http://www.public-health.uiowa.edu/p...hart_male3.zip

View Replies !    View Related
Dynamic Text Values
I'm having an odd problem with dynamic text boxes and I've not been able to work it out.

I have multiple dynamic text boxes in a MC they are numbered 0 thru 33 using the name fa (so the first text box is fa0 and the next is fa1 and so on and so forth).

I put inate values in them with thier corisponding number so fa0 has a value of "00" and fa1 has a value of "01" and so on.

I have a for loop in the thrid frame of the MC that runs once the movie reaches that frame (by user selection i.e. the user can pick what frame they want to goto)

Now the for loop runs and changes the values in the dynamic text boxes (I used the flash debuger to check the values) but the text in dynamic text boxes does not appear even though it has a new value in it the text area of the dynmaic text box reamins blank.

The dynamic text boxes are refrenced with _root.flb["fa"+cnt] = (some data here); The values in the debug menu change but the text does not appear for some reason.

Anyone have any thoughts on what might be wrong would be greatly apprishated.

Starwin

View Replies !    View Related
Editing Text In A Dynamic Text Box That Are Variable Values
Hi everyone, I want to adjust the space between characters in a dynamic text box, that is specified by the value of a variable and I´m going nuts trying to do it! I can´t edit the text much through the text options/properties, except the font. Can someone please help me out here?
Thanks.
Nick

View Replies !    View Related
Loading Values From A Text File Into Dynamic Text Box
Hello,

I'm using the as code to load a text file and trying to set it as the value for texboxes;


Code:
loadVariables("data.txt","");
date_text.text = date1;
title_text.text = title1;
entry_text.text = entry1;
the textfile is;

&title1=Welcome to my Flash Blog
&date1=13th November 2005
&entry1=This is the first entry in my blog. This is sample entry and all the data.


The as code has all the correct names of the dynamic text boxes, also it works fine if i put the names of the varibles from the text file as the var propertie of the tex boxes, but i dont want to use this method.

im sure its a silly little error, but been searching for a solution for over an hour with no luck

View Replies !    View Related
Dynamic Text Values In Calculator
I am new to flash and have a small amount of code that reads values from a database and then uses those values in a flash calculator, the database connection stuff is all ok and the dynamic text fiels that contain the values displayed on screen for the user contain the values they are meant to but when i use those values I always get an Nan in the result field, if I use numbers in the fields and don't read the values in from the database the calculation works, anyone help out on this? the code in the "Calc" button is below.

Many thanks in advance.

on (release) {
from = popup1.getValue(); // Currency to convert from
to = popup2.getValue(); // Currency to convert to
amount = (theamount*100)/100;

function calc() {

if (from == "gbp") {
if (to == "eur") {
result = (gbpeur*amount);
}
if (to == "usd") {
result = (gbpusd*amount);
}
}
if (from == "eur") {
if (to == "gbp") {
result = (eurgbp*amount);
}
if (to == "usd") {
result = (eurusd*amount);
}
}
if (from == "usd") {
if (to == "gbp") {
result = (usdgbp*amount);
}
if (to == "eur") {
result = (usdeur*amount);
}
}
result = (Math.round(result)); // result is the field name for the resulting calculation
}
calc();
}

View Replies !    View Related
Extracting Dynamic Text Values From .swf
I am trying to automate a task I do ofter which involves looking at a .swf and making decsions based on what the text is. I would like to extract the text I require and then I will programatically deal with it. Ideally I want to be able to call it from a command line command so I can integrate it with some perl.

Any hints on how I can extract the text to a file from the comand line. Below is a sample of the flash screen I need to interrogate and I want to be able to extract the values for "Heading" and "Wind Direction". Currently when ever I extract all I get are the heading tags and not the actual values.

View Replies !    View Related
Switching Variable Values In Dynamic Text...?
i have client.txt ( which contains a collection of 6 variables for 6 client comments client1= &client2= &client3= etc).

i am loading this into frame 1 of _root where the values will be stored:
client1= etc... no problem these values show up in the text fields used on the stage to test.

how do i get a button selection to fill another dynamic text field called content with the button's choice which will be essentially one of the client comment variables?

basically, how do i get the value of a specific client variable to become the content variable in my other text field?

i need code to make client1-6 load into _root.hold1.info.textbox where within the clip textbox is the textfield content..

i have tried in a button action :
on (release) {
set (content, client5);
clientswitch();
}

View Replies !    View Related
How To Load Different Values In Single Dynamic Text Box
Hai Flash experts

Sorry to bother u, but i need help, Plz give me a solution.

I've Two flash file that one contain links for headlines and another for story displaying.

Actually in my first file i given three headlines that if we click it should open the second
flash file to display story. Second file will load the text file to display the values. Its just working fine.
I don't have doubt in this.

In my text file variables and values are:

&head=News
&Headline1=After the close of...
&headline2=Several leading...
&headline3=Morning of...

What i have problem is that i'm not able to get an exact value to load in second file. That mean

If we click the second Headline link in first movie, it should open the second movie to display the variable value
of &headline2=.

if we click the first headline link then it should display value of &headline1= in second movie.

If u want my work file pls download from http://209.235.29.142/temp/sathish/testing.zip

That in single dynamic text box its possible to load different values from one text file.

I tried in different methods but i not able to get solution for this task. Can u help me to get finish this task.

thx
sathish

View Replies !    View Related
How To Load Different Values In Single Dynamic Text Box
Hai Flash experts

Sorry to bother u, but i need help, Plz give me a solution.

I've Two flash file that one contain links for headlines and another for story displaying.

Actually in my first file i given three headlines that if we click it should open the second
flash file to display story. Second file will load the text file to display the values. Its just working fine.
I don't have doubt in this.

In my text file variables and values are:

&head=News
&Headline1=After the close of...
&headline2=Several leading...
&headline3=Morning of...

What i have problem is that i'm not able to get an exact value to load in second file. That mean

If we click the second Headline link in first movie, it should open the second movie to display the variable value
of &headline2=.

if we click the first headline link then it should display value of &headline1= in second movie.

If u want my work file pls download from http://209.235.29.142/temp/sathish/testing.zip

That in single dynamic text box its possible to load different values from one text file.

I tried in different methods but i not able to get solution for this task. Can u help me to get finish this task.

thx
sathish

View Replies !    View Related
How To Load Different Values In Single Dynamic Text Box
Hai Flash experts

Sorry to bother u, but i need help, Plz give me a solution.

I've Two flash file that one contain links for headlines and another for story displaying.

Actually in my first file i given three headlines that if we click it should open the second
flash file to display story. Second file will load the text file to display the values. Its just working fine.
I don't have doubt in this.

In my text file variables and values are:

&head=News
&Headline1=After the close of...
&headline2=Several leading...
&headline3=Morning of...

What i have problem is that i'm not able to get an exact value to load in second file. That mean

If we click the second Headline link in first movie, it should open the second movie to display the variable value
of &headline2=.

if we click the first headline link then it should display value of &headline1= in second movie.

That in single dynamic text box its possible to load different values from one text file.

I tried in different methods but i not able to get solution for this task. Can u help me to get finish this task.

thx
sathish

View Replies !    View Related
Assigning Array Values To Dynamic Text
I've got an array with a lot of things I want to display in dynamic text fields, but I cannot get them to display. Just putting MyArray[1] in the varable field dosen't work. I've also tried assigning the varables in a for loop like this:


ActionScript Code:
["var"+i]=myArray[i];

also I've tried not useing the varable field and useing the instance filed

ActionScript Code:
["var"+i].text=myArray[i];

none of these worked for me. Any ideas?

View Replies !    View Related
Display Array Values In Dynamic Text Boxes
Hello,
I use Flash Studio Pro to pull and send info to an Access db. My question is more of a Flash question not a Flash studio question. My code is as follows:
FRAME 1

var db = "myDB.mdb";
var passdb = "mypass";
fscommand("flashstudio.connecttodb", "db,passdb");

FRAME 2

var select = "SELECT * from myTable";
fscommand("flashstudio.selectfromdb", "select");

FRAME 3

fieldDelimiter = ",";
rowDelimiter = ";";
fscommand("flashstudio.getdelfromdb", "myList,fieldDelimiter,rowDelimiter");

FRAME 4

listArray = new Array();
listArray = myList.split(rowDelimiter);

<b>How do I display the values that were pulled into the array into the dynamic text boxes?</b>

Thanks

View Replies !    View Related
Dynamic Text Fields Not Showing Values Assigned
I'm trying to add text to a dynamic text field on a movie clip that I am using as a button. It's actually a DTMF keypad I'm trying to create by using for loops to populate the text fields. No matter what I try it is not working. I step through the code and it goes through my function in its entirety, but the text labels are not showing any values.

I don't know if it matters, but the parent movie clip object of the buttons is not visible at start up (_visible = "false");

here's the code below for anyone who might be able to help:

function initializePageWindow(){
var alpha:Array= new Array("A", "B", "C", "D");

for(i=0;i<10;i++){
_root.winPage["btn"+i].txtBlack.text = i;
_root.winPage["btn"+i].txtWhite.text = i;
}

for(i=0;i<4;i++){
_root.winPage["btn"+i].txtBlack.text = alpha[i];
_root.winPage["btn"+i].txtWhite.text = alpha[i];
}
_root.winPage.btnStar.txtBlack.text = "*";
_root.winPage.btnStar.txtWhite.text = "*";

_root.winPage.btnHash.txtBlack.text = "#";
_root.winPage.btnHash.txtWhite.text = "#";

}

winPage is the parent, and the buttons are labeled btn0 through btn9, btnHash, and btnStar, and the reason for the two test boxes is for shading effect.

The text fields are named txtBlack and txtWhite respectively.

I would really appreciate any help I can get with this, I'm losing it.

Thanks in advance to anyone who can help.

View Replies !    View Related
[MX04] Dump Object Values To Dynamic Text Box
Hi folks, I'm kinda stuck. I can't get the values from my Object into a dynamic text box. It's clear I'm not understanding something.

I have a shared object, and the data is displayed in a data grid. So I am understanding what I really have is an Array of Objects.

So, when I set my text box to show the contents of this array, All I see is this in the text box:

[object, Obect],[object, Obect],[object, Obect]

So, It spits out that there is something there (3 items) but not the values. Hmm.

Here is code that puts data into the shared Object: ---------------

init = function () {
risk_so = SharedObject.getLocal("risks", "/");
if (risk_so.data.myRisks == undefined) {
risk_so.data.myRisks = new Array();
myrisk_txt.text = "Enter a Response Here and Click Add";
};

if (risk_so.data.mySource == undefined) {
risk_so.data.mySource = new Array();
input2_txt.text = "Enter a Response Here and Click Add";
}
//i = risk_so.data.myRisks.length;
//trace(i);
}
init();

myDataGrid1_grd.dataProvider = risk_so.data.myRisks;

trace(risk_so.data.myRisks);

//add to the 1st list
add1_btn.clickHandler = function() {
risk_so.data.myRisks.push({Possible_Risks:myrisk_t xt.text});
myDataGrid1_grd.dataProvider = risk_so.data.myRisks;
myrisk_txt.text = "";
trace("add1 was clicked");
}

------------------------------------------------------

Again, I am trying to get this to a plain old dynamic text box.

Much thanks for looking.

John

View Replies !    View Related
Incrementing Values In A Dynamic Text Field Using Buttons
Second question today.

So I have a movie with 2 dynamic text fields and 2 buttons for each. I want one button for each field to increase the number in the text field by 5 and one to decrease it by 5. Here's how I'm trying to do this:


Code:
var leftTextVar:int = 0;
var rightTextVar:int = 0;

LeftText.text = leftTextVar;
RightText.text = rightTextVar;

LeftUpButton.addEventListener(MouseEvent.MOUSE_UP, leftScoreUp);
LeftDownButton.addEventListener(MouseEvent.MOUSE_UP, leftScoreDown);
RightUpButton.addEventListener(MouseEvent.MOUSE_UP, rightScoreUp);
RightDownButton.addEventListener(MouseEvent.MOUSE_UP, rightScoreDown);

function leftScoreUp(evt:MouseEvent):void {
leftTextVar += 5;
LeftText.text = leftTextVar;
}

function leftScoreDown(evt:MouseEvent):void {
leftTextVar -= 5;
LeftText.text = leftTextVar;
}

function rightScoreUp(evt:MouseEvent):void {
rightTextVar += 5;
RightText.text = rightTextVar;
}

function rightScoreDown(evt:MouseEvent):void {
rightTextVar -= 5;
RightText.text = rightTextVar;
}
here's the error I get:

[i]1067: Implicit coercion of a value of type int to an unrelated type String.

View Replies !    View Related
Trying To Loop A Movie Clip With Different Dynamic Text Values
Hi there,
Hope someone out there can help! I'm fairly new to actionscripting, though I can program in Javascript, ASP and PHP pretty well. I'm having some trouble with this basic task and it's a roadblock for me!

I have an empty movie clip that I load as a "container." What I want to do is loop through an array that has some text values, and each time I want to do 3 things:
1) load a generic movie clip from my library (which has a dynamic text field) into the empty movie clip container
2) assign the text value to the dynamic text field
3) remove the generic movie clip

here is the code I have:

name_text_array = ["First Name","Second Name","Third Name"];
_root.createEmptyMovieClip("my_mc",1);
my_mc._x = 200;
my_mc._y = 200;

for (i=0;i<name_text_array.length;i++) {
my_mc.attachMovie("nameclip","nameclip_mc",1);
my_mc.nameclip_mc.name_text.text = name_text_array[i];
removeMovieClip("nameclip_mc");
}

obviously this doesn't work - what happens is that I get one iteration of the loop with the last value "Third Name" only displayed. I put a trace in the loop, and it does spit out all the text values correctly so I know the loop itself is iterating properly.

So in short what I want to happen is I want to see the movie clip 3 times, displaying each of the sequential array items.

I seem to be missing something! Please help!

thanks in advance!

View Replies !    View Related
Retreiving MySQL Values -> Flash Dynamic Text Field
Hi, im having some trouble as to how to retreive data from MySQL Database fields and putting it into a dynamic text field in Flash... can anyone help?

View Replies !    View Related
Adding Value To A Dynamic Text Box
hey, i was wondering if any of you peoples know how to make a dynamic text box and every time you click a button, a value of 10 increases in the text box.

so like this happens:
click button - box displays "10"
click it again - box displays "20"


help would be so awesomely appreciated.

View Replies !    View Related
Adding To A Dynamic Text Box
hey i was wondering how one would go about making a button that adds the value of 10 to a dynamic text box, but, i wanna know how to do this with multiple buttons that share the same function.

for example:
click button 1, text=10
click button 2, text=20
click button 1 again, text=30

help me please!

View Replies !    View Related
[CS3] Adding To Dynamic Text
I'm trying to create a text-editor type thing. You can enter your own text, and buttons at the side will also enter pre-defined text, such as the users name.
The problem I have is that If I have finished typing want to use the "insert name" button, pressing it will just add my name to the end of the text and not where I place my cursor (blinking line).

Anyone know if its possible to make a button insert text where the cursor is?
And if so, how.
Thanks =)

I think ive attatched a example pic to try and explain it better. Im not to used to this forum =P

View Replies !    View Related
Adding Dynamic Text From Xml, HOW?
Hi,
I got the 3D DistortImage Photo Stack from Lee Brimelow, you can see it here - http://theflashblog.com/?p=224. I got it working perfect. I got it loading images from an xml file. I just can get it to load the caption from the file. Im a newbie at AS and XML.
Would like some help in including the caption from the xml file. I am including the full AS file below as well as the XML file. Thanks in Advance.


Code:
import flash.display.BitmapData;
import sandy.util.DistortImage;
import com.mosesSupposes.fuse.*;
import mx.utils.Delegate;

ZigoEngine.register(Fuse, PennerEasing);
photo._visible = false;


var base:MovieClip = this;
// xml file path
var xmlFile:String = "fotos.xml";
//image directory path
var imageDir:String = "";

// strange brew: is needed to view distort image??? why???? dont ask me :[
var f1:Fuse = new Fuse();
f1.push({target:photo, x:200, time:0.3, delay:3.15, ease:"easeOutExpo"});
f1.start();
delete f1;


var tran:Object = new Object();
tran.x1 = 0;
tran.y1 = 0;
tran.x2 = 0;
tran.y2 = 0;
tran.x3 = 0;
tran.y3 = 0;
tran.x4 = 0;
tran.y4 = 0;


var photos:Array;
var pictIndex:Number = 0;
var fuseCmds:Array = new Array();
var f:Fuse;
var photos:Array;

var theOne:MovieClip;

var pictListener:Object = new Object();


f = new Fuse();

var xmlFeed = new XMLPictLoader(xmlFile,this);
//start loading will call postXMLLoaded after finish
xmlFeed.addEventListener('xmlLoaded', Delegate.create(this, postXMLLoaded));



function postXMLLoaded(eventObj):Void
{
trace(eventObj.message);
photos = eventObj.data;
for (var k=0; k < photos.length;k++)
{
//create a movie clip to hold the external file
base.createEmptyMovieClip("holder_mc"+k,base.getNextHighestDepth());
base["loader"+k] = new MovieClipLoader();

//Give us status updates by firing events
base["loader"+k].addListener(pictListener);
// trace("start loading["+k+"]: "+photos[k]);
//load the picture
base["loader"+k].loadClip(imageDir+photos[k],"holder_mc" + k);
base["holder_mc"+k]._x = 60*k;
base["holder_mc"+k]._alpha = 0;

}

}



pictListener.onLoadInit = function(targetMC:MovieClip):Void
{

//trace ( "LOADING OF " + targetMC + " COMPLETE:" + pictIndex);
var i:Number = pictIndex;
pictIndex++;
trace("target width:"+targetMC._width);

//calculate the perspective
var p:Picture = new Picture(targetMC._width,targetMC._height);

p.p_width = targetMC._width;
p.p_height = targetMC._height;

p.perspective = 55;
p.z_value = 90;
p.viewport = -150;

p.calc();

//trace("photo width:"+targetMC._width+" photo_height:"+targetMC.height);
base["bmd"+i] = new BitmapData(targetMC._width, targetMC._height);
base["clip"+i] = base.createEmptyMovieClip("holder"+i, i);
base["clip"+i]._x = 800;
base["clip"+i]._y = 250;
base["clip"+i].p = p;
trace(base["clip"+i].p.toString());
base["clip"+i].cacheAsBitmap = true;
base["di"+i] = new DistortImage(base["clip"+i], base["bmd"+i], 1, 1);
base["di"+i].setTransform(p.p1.x, p.p1.y, p.p2.x, p.p2.y, p.p3.x, p.p3.y, p.p4.x, p.p4.y);
//Snapshot the movie clip that contains the external file we loaded
base["di"+i].texture.draw(targetMC);
base["clip"+i].di = base["di"+i];
base["clip"+i].num = i;
base["clip"+i].onRollOver = down;
base["clip"+i].onRollOut = out;
base["clip"+i].onRelease = rel;
base["clip"+i].x = (150+i*50);
//base["clip"+i]._x = (i*50);
fuseCmds.push({target:base["clip"+i], x:(200+i*50), time:1.3, delay:i*0.15, ease:"easeOutExpo"});
delete targetMC;

checkPictureLoad();

}

function checkPictureLoad():Void
{
//trace("check:"+pictIndex+":"+photos.length);
if(pictIndex >= photos.length){

f.push(fuseCmds);
f.push({func:function(){base.onEnterFrame = enterer}});
f.start();

}
}

/*
* Release OnClick Event
*
**/
function rel():Void
{
noReleaser(this);
scaleTheRest(this);
delete base.onEnterFrame;
this.swapDepths(base.getNextHighestDepth());

// set the transition object to current points
tran.x1 = this.p.p1.x;
tran.y1 = this.p.p1.y;
tran.x2 = this.p.p2.x;
tran.y2 = this.p.p2.y;
tran.x3 = this.p.p3.x;
tran.y3 = this.p.p3.y;
tran.x4 = this.p.p4.x;
tran.y4 = this.p.p4.y;

var f:Fuse = new Fuse();
// set front pict
f.push([{target:base.tran, x1:this.p.p1_default.x, y1:this.p.p1_default.y, x2:this.p.p2_default.x, y2:this.p.p2_default.y, x3:this.p.p3_default.x, y3:this.p.p3_default.y, x4:this.p.p4_default.x, y4:this.p.p4_default.y, time:1.5, scope: this, updfunc: "updateTransform"},
{target:this, x:251, y:240, time:1.8, controlX:500, controlY:0}
]);
//f.push({func:function(){delete this.onEnterFrame;}});
f.start();
//trace("updateTransform"+base.tran.x1+":"+base.tran.y1+":"+ base.tran.x2+":"+ base.tran.y2);
this.onRelease = base.closeIt;
}

function closeIt(nu:Number):Void
{
unscaleTheRest(this);
var f:Fuse = new Fuse();
//trace("mc:"+this+"
punkt:"+this.num+"
"+this.p.toString());
f.push([{target:base.tran, x1:this.p.p1.x, y1:this.p.p1.y, x2:this.p.p2.x, y2:this.p.p2.y, x3:this.p.p3.x, y3:this.p.p3.y, x4:this.p.p4.x, y4:this.p.p4.y, time:1.5, scope: this, updfunc: "updateTransform"},
{func:function(){this.swapDepths(this.num);}, delay:0.3, scope:this},
{target:this,x:this.x, y:250, time:1.1, controlX:500, controlY:50}
]);
f.push({scope:this,func:function(){base.reReleaser();}}); //delete this.onEnterFrame;
f.start();
base.onEnterFrame = enterer;
this.onRelease = base.rel;
}


function down():Void
{
//var s:Sound = new Sound();
//s.attachSound("an");
//s.start();
theOne = this;
}

function enterer()
{
for(var i=0;i<photos.length;i++)
{
//trace(i+":"+theOne.num);
if(i<=theOne.num) base["clip"+i].dir = base["clip"+i].x - 100;
else base["clip"+i].dir = base["clip"+i].x + 100;
base["clip"+i]._x += (base["clip"+i].dir -base["clip"+i]._x)*0.2;// - _global.container_offset;
}
}

function scaleTheRest(who:MovieClip):Void
{
delete who.onRollOver;
var f:Fuse = new Fuse();
var fa:Array = new Array();
for(var i=0;i<photos.length;i++)
{
if(base["clip"+i] != who)
{
fa.push({target:base["clip"+i], y:300, scale:30,time:1.5});
}
}
f.push(fa);
f.start();
}

function noReleaser(who:MovieClip):Void
{
for(var i=0;i<photos.length;i++)
{
if(base["clip"+i] != who)
{
delete base["clip"+i].onRelease;
delete base["clip"+i].onRollOver;
}
}
}

function reReleaser(who:MovieClip):Void
{
for(var i=0;i<photos.length;i++)
{
base["clip"+i].onRollOver = base.down;
base["clip"+i].onRelease = base.rel;
}
}

function unscaleTheRest(who:MovieClip):Void
{
var f:Fuse = new Fuse();
var fa:Array = new Array();
for(var i=0;i<photos.length;i++)
{
if(base["clip"+i] == who) continue;
fa.push({target:base["clip"+i], y:250, scale:100,time:1.5});
}
f.push(fa);
f.start();
}


/* sector fix
*
**/
function updateTransform (): Void
{
//trace("updateTransform"+base.tran.x1+":"+base.tran.y1+":"+ base.tran.x2+":"+ base.tran.y2);
this.di.setTransform(base.tran.x1, base.tran.y1, base.tran.x2, base.tran.y2, base.tran.x3, base.tran.y3, base.tran.x4, base.tran.y4);
}
This is the XML File:

Code:
<map>
<image url="1.png" caption="The caption goes here for one." />
<image url="2.png" caption="The caption goes here for two." />
<image url="3.png" caption="The caption goes here for three." />
<image url="4.png" caption="The caption goes here for four." />
<image url="5.png" caption="The caption goes here for five." />
<image url="6.png" caption="The caption goes here for six." />
</map>
external xml class file:


Code:
import mx.events.EventDispatcher;

class XMLPictLoader extends XML
{

public var photo_urls:Array = new Array();
private var fileName:String;
private var controller:Object;

var addEventListener:Function;
var removeEventListener:Function;
var dispatchEvent:Function


public function XMLPictLoader(file:String,cont:Object)
{
EventDispatcher.initialize(this);

this.fileName = file;
this.controller = cont;
this.ignoreWhite = true;
this.load(file);

}

public function onLoad():Void
{
var nodes:Array = this.firstChild.childNodes;
for(var i=0;i<nodes.length;i++)
{
this.photo_urls.push(nodes[i].attributes.url);
}
//trace ("xmlLoaded");
//this.toString();
//this.controller.postXMLLoaded();
dispatchEvent({type:'xmlLoaded', target:this, message:'Das XML ist da.',data:this.photo_urls});
}

public function toString()
{
if(this.loaded){
//trace("Loaded File:" + this.fileName);
//trace("Loaded Pictures:"+this.photo_urls.length);
for(var i=0;i<this.photo_urls.length;i++){
trace(this.photo_urls[i]);
}
} else {
//trace("File not loaded:" + this.fileName);
}
}


}

View Replies !    View Related
Adding Sound To Dynamic Text
Well to begin with, i think i'll tell you a story... so sit close and i'll begin :P

I've been going back to my old favorite games collection and pulled out Command and Conquer: Tiberium Sun, which im pretty sure you've all at least seen someone play it. Tis a grand game, but not as good as trusty Red Alert... my, those were the days... *cough* *cough*

uh... sorry, got carried away

N E ways, back on track, after completing a mission, you gain the usual score screen like in all CnC games, but when you input a high score into the spot allocated, each key you press gives off a sound (all the make the same sound), a sort of fancy thing that just makes the game even cooler.

Im making a flash bar for my new site to input a pass to gain access just for the hell of it, but i'd like to use the same idea for when a person inputs they're pass using the form text, it's either dynamic or something else... but yeah... i don't have a clue how to do it:

Any help would be fantastic, thanks for listening to me drone on and on and on and on and o... sorry

blade

View Replies !    View Related
Adding Text To A Dynamic Textbox
I tried the search but couldn't figure it out:
I'm trying to add text to a dynamic textbox with a button, without erasing the text that is allready in it.
when I set the actions to a button as
variable=textbox
value=whatever
it will allways erase the previous entered text. is there a way to add text everytime you hit a button refering to the same textbox?

gracias very mutch

View Replies !    View Related
Adding PICS In A Dynamic Text Box
How i can do that ! is there any possible way !!!


thx a lot



Im a newb :P

View Replies !    View Related
Adding Photo In Dynamic Text Box
Is it possible to add photo in a dynamic text box... if so. adding a url button too..


thx a lot

View Replies !    View Related
Problem Adding Dynamic Text
im new to flash programming, and am having some trouble getting text to output to the instances of my dynamic text fields


Code:
uMax = 5
for (i = 0; i < uMax; i++) {
clip = attachMovie("Container", "u" + i, i);
setProperty("u" + i, _y,i * 14);
clip.createTextField ("m" + i, i, -130, -10, 150, 20);
dup2 = "m" add i ;
clip.dup2.text = "hi123456789"
}
when I trace dup2 its outputting correctly (m1, m2...etc) but in flash doesnt seem to read a variable passed this way (it works fine if i change dup2 to m0 for example) Is there any other way i can output this variable? or is it something im missing?

Thanks in advance.

View Replies !    View Related
Having Trouble With Dynamic Text Adding, Etc
Hello, Ive gotten lots of help here for my dynamic text and this is the last thing to complete my site.

What I have is a main scene with 2 movie clips
one movie clip you make a selection
the other movie clip shows the total cost, adding or subtracting the amount of your choice.

Its confusing so ill show you what code I have
On first frame of the main scene

Code:
_root.baseprice=700;
_root.surfaceprice=0;
_root.cupprice=0;
_root.legprice=0;
_root.addonprice=0;
_root.total_price=_root.baseprice + _root.surfaceprice + _root.cupprice + _root.legprice + _root.addonprice;


In the movie clip where I want to display the total (named "right"), i have a dynamic text field var: named "total_price" and this code in the first frame of the clip

Code:
_root.right.total_price=_root.total_price;


Now this displays the "700" like it should. But I want it to change as i make my selections in the other movie clip.
So I have this code for 3 buttons, one button makes the value 0, one 100, and one 200.

Code:
//first button
on (press) {
_root.surfaceprice =0;

//different button
on (press) {
_root.surfaceprice =100;

//last button
on (press) {

_root.surfaceprice =200;



So, in theory, shouldnt pressing these buttons change the value of the "_root.surfaceprice" in the main scene, then in turn chang the value of the "total_price" in the other movie clip?

Thank you for the help.
Brian

View Replies !    View Related
Adding Text To A Dynamic Textbox
I am trying to make a flash program for the psp's flash player. In it, there is pretty much only reliable mouse support, and no text imput. To fix this problem, i'm making a keyboard out of buttons. When you click a button, it adds the letter it represents to what the textbox already has. I don't know how to do this with actionscript. Ive tried using my_text.text = ..... but i can't get it to add. How can i accomplish this. Ps: Im kinda an actionscript noob, so if you could explain how the code works that would be helpful. Thanks.

oh and btw. it needs to be in actionscript 1.0

View Replies !    View Related
Adding Actions To Dynamic Text
Is there a way to add an action to a text string inside a dynamic text field?

I have a dynamic text field that I am going to populate with search results. The text field will list the results of a user search. Users need to be able to click on a result to load a certain part of a movie.

As an example, say I have the following text inside a dynamic text field:

"Click here to say hello"

I want the text "Click here" to perform the following action:

trace("Hello");

Is this possible or do I need to find another way to do it?

View Replies !    View Related
Adding Stroke To Dynamic Text
Anyone know how to add a stroke to dynamic text via actionscript only? The text does not need to remain dynamic, but the whole process has to happen with code.

View Replies !    View Related
Adding To A Dynamic Text Field
Is there a way to add info to a dynamic text field?

For example, if an object on the stage is pressed it's name and color get sent to a text field. When another one gets pressed i want it's name and color to be added below the previous one so a list is created. But, if the shape and color is changed on the first object it will update the text field that previously described it. Is this possible?

View Replies !    View Related
Adding Actions To Dynamic Text
Is there a way to add an action to a text string inside a dynamic text field?

I have a dynamic text field that I am going to populate with search results. The text field will list the results of a user search. Users need to be able to click on a result to load a certain part of a movie.

As an example, say I have the following text inside a dynamic text field:

"Click here to say hello"

I want the text "Click here" to perform the following action:

trace("Hello");

Is this possible or do I need to find another way to do it?

View Replies !    View Related
Adding Text To Dynamic Textfields
Hey fellas,

Quick question,

Is it possible to increment a text field with another line of text?

I know you can change the whole text using "textfield.text = new text" but i want to add it on to the end of the current text stored within it. Any easy way i've missed?

Cheers,

Danny W

View Replies !    View Related
Adding A Link To Dynamic Text
I have a scrolling dynamic text box in which I have a web address that i need to be made active so people can click on it and it'll take them to another HTML page. how do i go about doing that?

View Replies !    View Related
Adding Dynamic Text Boxes
Hello Everyone,

Does anyone out there know how to add to dynamic text boxes together in Flash? Or, can it be done? For example: I have 3 dynamic text boxes (txt1, txt2, txt3). I have a button called "Add". When I run the movie, I type in txt1 "5", in txt2 "4", on press of button "Add". I want the sum of txt1 + txt2 to show up in txt3. To be more clear, the code I have now looks like this.


ActionScript Code:
on(Press){
txt3 = txt1 + txt2
}
}

but that doesn't work. only txt1 shows up in txt3.

Does anyone know how I can accomplish this?

View Replies !    View Related
Adding Returns In Dynamic Text Box
Does anybody know how to add hard returns in the text in a dynamic text box???

Do I have to render as HTML?

instance name: bodytext
var name: text

Thanx!!!

View Replies !    View Related
Adding Scroller To Dynamic Text Box?
hey guys,

Great site! I have a question tho. How do i add a scroller to my dynamic text box in flash mx 2004?

thanks in advance.

and thanks for every1s hard work on this community^^

View Replies !    View Related
Adding Images Into Dynamic Text
I want to place images into a scrolling dynamic text box. How can I tell the image to appear exactly were I want it to.
Or
Another idea I had was having another movie with the images in it loading inside my container off a button in the original movie.... what would be the script for this?? A movie loading into itself, as if..... Thanks a mil.

View Replies !    View Related
Adding Bullets To Dynamic Text
I'm trying to add bullets to some dynamic text I've got from some xml. everything works in my movie text wise except the bullets. I'm adding a textformat - here's current code as part of initial load (change event is handled elsewhere (again, works except for bullets)

var textFormat:TextFormat = new TextFormat();
textFormat.bullet = true;
roomdesctext.setTextFormat(textFormat);
roomdesctext.text = roomxml.image[0].attribute("description");

View Replies !    View Related
Adding Returns In Dynamic Text Box
Does anybody know how to add hard returns in the text in a dynamic text box???

Do I have to render as HTML?

instance name: bodytext
var name: text

Thanx!!!

View Replies !    View Related
Adding Scroller To Dynamic Text Box?
hey guys,

Great site! I have a question tho. How do i add a scroller to my dynamic text box in flash mx 2004?

thanks in advance.

and thanks for every1s hard work on this community^^

View Replies !    View Related
Adding Symbols To Dynamic Text
I'm modifying an existing Flash site and running into some complications that I hope someone here can help me out with. The current site has a few pages with a restricted text area, but the copy exceeds the size of that text area. Due to time and budget constraints, the easiest way to solve it was to create the text field as dynamic and allow it to scroll. The only problem is that a few pages where this is done, the client wants to include hyperlinks, which doesn't seem possible with dynamic text. My question is, can I drop in a symbol within the dynamic text field that will be able to be hyperlinked, but still scroll with the rest of the text?

View Replies !    View Related
Adding Text To Dynamic Text Field (help Please Heh)
hi everyone,

rather simple question im sure..

I have a dynamic text box that already has text in it, and on the push of a button I'd like to add text to the box, rather then just set the variable to new text..

for example the box as one "X" in it, and I need to add another so that it displays "X X", and so on...

help is much appreciated!

- lenny

View Replies !    View Related
Adding Values [or Something]
hullo peeps i'm new here, and new to action scripting, sort of. i've put a clock on my site, using this tutorial:

http://www.flashkit.com/tutorials/Ac...21/more5.shtml

just now, i've adapted it to show the date as well, but i've noticed that it takes january as month number 0, and so may becomes month number 4.

how can i rectify this? it should be pretty simple, right?

thanks in advance

View Replies !    View Related
Adding 2 Values
Hi Guys, man I feel like a real idiot asking this..

I was wondering if you could tell me why I can't add two values from 2 textfields? I'm using this code!

on(release){
resultbox=box1+box2;}

It works fine with minus or multiply! but it just adds the numbers together literally!! like 5+5 is 55.

Can you please help me?

Thanks!

View Replies !    View Related
Adding Values
I'm missing something here, I know. I'm trying to add the values of 3 text fields, t1, t2, t3. If I make each field's value 1, for some reason I keep on getting the answer as 111. Please could you give me the right code on a button to add the values of these?

View Replies !    View Related
Adding Line Breaks In Dynamic Text
It seems like it should be easy, but I am trying to add hard line breaks to text strings that I am building dynamically, and can't find the right code to insert these breaks. Any help would be appreciated

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved