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




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



FlashKit > Flash Help > Flash Newbies
Posted on: 08-26-2005, 03:55 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Having Trouble Adding Additional Text To Text Stored In Var
How can i add "&print=page" to printVar=facility.php?type=all&state=ak so it would be, printVar=facility.php?type=all&state=ak"&print=pag e in a button?
I tried this and it won't work..
[code]
on(release){
getURL(printVar+"&print=page")
}
or
on(release){
newPrintVar = printVar+"&print=page"
getURL(newPrintVar)
}

[flash8] Trouble Highlighting Specific Areas Of Text In A Dynamic Text Box
Hi all, I'm currently trying to work out a method to highlight specific areas of text within a dynamic text field at runtime.
The method I've been toying with so far has been the use of CSS highlighting, but have not seemed to have any luck thusfar. What I'm attempting to do is to illustrate, to students, sections within a passage of text pertaining to correct methods of source referencing (source in terms of bibilographical references), and so am essentially trying to change the background colour of sections of text specified at runtime.
Here's some code I've thrown together to test the CSS theory:

PHP Code:



var highlightstyle = 'span.highlight { background-color:yellow }';var txt = '<p><span class="highlight">highlighted text</span> non highlighted text<span class="highlight"> more highlighted text</span></p>';txtbox.html = true;txtbox.styleSheet = highlightstyle;txtbox.htmlText = txt; 




however it don't work...and here I was thinking this would be a fairly easy affair
Any ideas?

Trouble Parsing Name To Dynamic Text Field .text Property
Hia, I'm making a media player with a playlist, when a list item is selected the 'name' (of selected track) should be parsed from the xml into the dynamic text field (title_txt).

What's happening is when the swf starts title_txt contains "level0.title_txt", when you first click an item, title_txt is parsed "undefined".

The trace function I set up to mimic this also brings back "undefined".

I'm not sure what's happening, any help would be really appreciated.

In my fla, I have:a list component inth an instance name of "list"
a video holder with the instance name of "video"
a title box with a var of "title_txt"

its a pretty simple fla.

the list is populated by xml

XML Code:
<xml>    <listitem name="Battle 1" url="streams" thumb="battle1.jpg">        <stream name="battle1.flv" start="0" len="-1"/>    </listitem> 
    <listitem name="Fight!!!" url="streams" thumb="fight.jpg">        <stream name="fight.flv" start="0" len="-1"/>    </listitem>        <listitem name="Marco Diaper" url="streams" thumb="marcodiaper.jpg">        <stream name="marcodiaper.flv" start="0" len="-1"/>    </listitem> 
    <listitem name="Cheetah Cougar" url="streams" thumb="cheetahcougar.jpg">        <stream name="cheetahcougar.flv" start="0" len="-1"/>    </listitem>        <listitem name="Cloning" url="streams" thumb="cloning.jpg">        <stream name="cloning.flv" start="0" len="-1"/>    </listitem>        <listitem name="Run" url="streams" thumb="run.jpg">        <stream name="run.flv" start="0" len="-1"/>    </listitem>        <listitem name="Midgets 1" url="streams" thumb="midgets1.jpg">        <stream name="midgets1.flv" start="0" len="-1"/>    </listitem>        <listitem name="Midgets 2" url="streams" thumb="midgets2.jpg">        <stream name="midgets2.flv" start="0" len="-1"/>    </listitem>        <menu>        <listitem name="Battle 1"/>        <listitem name="Fight!!!"/>        <listitem name="Marco Diaper"/>        <listitem name="Cheetah Cougar"/>        <listitem name="Cloning"/>        <listitem name="Run"/>        <listitem name="Midgets 1"/>        <listitem name="Midgets 2"/>    </menu></xml>

This is my main actionscript file (VideoSourcePro.as), line 65 is where the problem is.

Actionscript Code:
bG_mc.setStyle ("backgroundColor", 0x404040);trans_mc.setStyle ("backgroundColor", 0x404040); 
mx.controls.treeclasses.TreeRow.prototype.drawRowFill = mx.controls.listclasses.SelectableRow.prototype.drawRowFill = function (mc:MovieClip, newClr:Number) {    this.setStyle("backgroundColor", 0x404040);    switch (mc._name) {    case "bG_mc" :        //Alpha when the row is not selected        var tempAlpha = 0;        break;    case "tran_mc" :        //Alpha when the row is selected        var tempAlpha = 10; 
        break;    default :        var tempAlpha = 10; 
    }    mc.clear();    //Here's the trick:    mc.beginFill(newClr, tempAlpha);    mc.drawRect(1, 0, this.__width, this.__height);    mc.endFill();    mc._width = this.__width;    mc._height = this.__height;    //Hide the main bg of component    list.depthChild0._alpha = 0;};//Set up the list box, call function VideoThumb to create the actual thumbnailslist.rowHeight = 70;list.cellRenderer = "VideoThumb";list.selectable = true;list.setStyle("color", 0xFFFFFF);list.setStyle("fontSize", 12);list.setStyle("fontFamily", "Verdana");list.setStyle("backgroundColor", 0x404040);listitem.setStyle("backgroundColor", 0x404040); 
title_txt.setStyle("color", 0xFFFFFF);title_txt.setStyle("fontSize", 12);title_txt.setStyle("fontFamily", "Verdana");title_txt.setStyle("backgroundColor", 0x404040);title_txt.setStyle("backgroundColor", 0x404040);//create new empty listener objectlistListener = {};//Function to handle what happens when an item in the list is selectedlistListener.change = function(evtobj) {    var nav = list.dataProvider[list.selectedIndex];    nc = new NetConnection();    //create a connection    nc.connect(null);    //null connection for progressive download    ns = new NetStream(nc);    //create a stream    video.attachVideo(ns);    //pipe stream to this video object    // walk through the chosen item, build and play it      var reset = true;    for (var i = 0; i < nav.childNodes.length; i++) {        var stream = nav.childNodes[i];        if (stream.nodeName == "stream") {            // build path to flv, and play it            myStreamPath = nav.attributes.url + "/" + stream.attributes.name;            title_txt.text = nav.name;            trace(nav.name + "_" + "title_txt");            ns.setBufferTime(10);            ns.play(myStreamPath);            reset = false;        }            }    };//Add an event listener on the list, when it triggers, run the listListener function to repopulate the listlist.addEventListener("change", listListener);//Function that loads the XML file, parses it, and builds the list of available video clipsvar xmllist = new XML();//setup a variable to hold the XMLxmllist.ignoreWhite = true;xmllist.load("playlist-demo-1.xml");//load the XML file//The following gets called when the XML has been loadedxmllist.onLoad = function(status) {    if (!status) {        trace(status);    }    var entries = this.childNodes[0];    var playlists = {};    var nav = [];    for (var i = 0; i < entries.childNodes.length; i++) {        var entry = entries.childNodes[i];        if (entry.nodeName == "listitem") {            //builds array of video clip names            playlists[entry.attributes.name] = entry;        } else if (entry.nodeName == "menu") {            //builds array of available videos            for (var j = 0; j < entry.childNodes.length; j++) {                nav[j] = playlists[entry.childNodes[j].attributes.name];            }        }        //end else if        }    //end if    //sends the array of videos to the listbox UI    list.dataProvider = nav;};//end xmllist.onload 
//resizes the video object to the width and height of the clip function onVideoResize() {    if (video.width != video._width || video.height != video._height) {        video._width = video.width;        video._height = video.height;        //center video in playback area        newx = (400 - video._width) / 2;        newy = (335 - video._height) / 2;        video._x = newx;        video._y = newy;    }}setInterval(onVideoResize, 200);//keeps checking video size

And this is the actionscript file which gets the thumbnails for the list (VideoThumb.as)

Actionscript Code:
class VideoThumb extends mx.core.UIComponent {    static var symbolName = "VideoThumb";    var label:Object;    // the new text label we'll use    var listOwner:Object;    // reference to the tree - supplied by the tree    var thumb;    var nc;    // NetConnection    var ns;    // NetStream    var streamurl;    function VideoThumb() {        // nothing needed - we're extending v2;    }    function init() {        // nothing needed - we don't have any instance variables to initialize    }    function createChildren(Void):Void {        // attachMovie (linkageID, new name, depth)        var v = this.attachMovie("VideoHolder", "thumb", 0);        v._width = 80;        v._height = 60;        v.styleName = listOwner;        var c = createLabel("label", 1);        c.styleName = listOwner;        c.selectable = false;    }    // pass all sizing from the tree to the cell    function size(Void):Void {        label.setSize(label.getPreferredWidth(), label.getPreferredHeight());        label._x = thumb._width + 10;        label._y = thumb._height / 2 - label._height / 2;    }    // str is the suggested string to render from the tree (based on the node)    // node is the entire XMLNode for the row    // sel is the selected state (not usually used)    function setValue(str:String, item, sel) {        _visible = item != undefined;        if (!_visible) {            return;        }        label.setValue(item.attributes.name);        //trace(item.attributes.name);        // Thumbnail is picked up as the first frame of the playlist        var url = item.attributes.url;        var stream = item.attributes.thumb;        var start = item.attributes.thumbpos;        //grab jpg thumbnail instead of initiating stream        var newClip = this.createEmptyMovieClip("thumbie", this.getNextHighestDepth());        newClip.loadMovie("thumbs/" + stream);        // If explicit thumb is not specified use the        // start frame of the first stream        if (stream == undefined) {            stream = item.childNodes[0].attributes.name;            start = item.childNodes[0].attributes.start;        }        // Give up if we still don't have valid thumb info         if (stream == undefined) {            return;        }        // Render the thumbnail only if necessary         if (streamurl == url + "/" + stream) {            return;        }        streamurl = url + "/" + stream;        //trace( streamurl );        trace(stream); 
            }    // ensures the cell is centered vertically properly - luckily, the label also implements this method.    function getPreferredHeight() {        return 60;    }    function getPreferredWidth() {        return label.getPreferredWidth();    }}

I've also zipped up the source files and uploaded them, they can be downloaded from here.

Thank you in advance.
James

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.

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!

[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

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);
}
}


}

Dynamic Text Trouble
Im loading an external txt file into a dynamic text field but my problem is i cant get it to display right in the text field what im trying to do is get the text to display like so

1
2
3

instead all i can get is

1

2

3

is there anyway to get rid of those extra spaces so the text lies beneath instead of spacing itself out like that? is it done in the txt file itself or somewhere else any help would be great thanks

Trouble With XML And Dynamic Text
I've attached the code below. It is only displaying the last entry. How can I get it to display all of them? When I trace list[i] it outputs all of it.

Attach Code


Code:
var list:XMLList = xml.na.officelist.office;

for( var i:uint = 0; i < list.length(); i++){
na2_txt.text = list[i];
}

Dynamic Text Trouble
Im loading an external txt file into a dynamic text field but my problem is i cant get it to display right in the text field what im trying to do is get the text to display like so

1
2
3

instead all i can get is

1

2

3

is there anyway to get rid of those extra spaces so the text lies beneath instead of spacing itself out like that? is it done in the txt file itself or somewhere else any help would be great thanks

Dynamic Text Trouble
I created a dynamic text box and masked it. However, whenever I change the text of the dynamic text box object. The text is not changing however when I check the attribute .text the text is changed.

I have the fonts embed and tried the to change the text manually (hard code it) and read off text file. The font is in library and has a linkage.

There is someting wrong with my setup, I am sure (duh!).

The following is my code:http://pastebin.sekati.com/?id=Vinny@b5fe5-a4f08814-t

Any suggestions?

Thank you,
Vinny P

Dynamic Text Trouble
Well...

I have a dynamic text box. The text within it is loaded from an ASP file (but that really doesnt matter) and i wanted to know if there a way to check the text inside the box. the asp file will load in some text and if you are not logged in it will change the text inside to "login to see info"

i thought of just saying

if(_root.textbox == "text"){
_root.textbox = "login to see info"
}

but it doesnt work. if i make the information undefined then this works

if(_root.textbox == undefined){
_root.textbox = "login to see info"
}

so i think there is some way to make it work.

Thanks for your help
Stupidsaint

Trouble With Dynamic Text
Hi there...

I'm trying to get 3 variables from my ASP-page into Flash. But it ain't working...

I was told to use this code (part of the code of the ASP-page containing the .swf):

<param name="movie" value="game.swf" />
<param name="quality" value="best" />
<param name="phone" value="0673755324" />
<param name="highscore" value="235" />
<param name="username" value="Peter" />

And this is the code I'm using in Flash:


ActionScript Code:
loadVariables("test.asp",0);


Can anyone tell me what I'm doing wrong?

Thnx...

Leon

Trouble W/ Dynamic Text Box
Hi.. I'm trying to load text in HTML format from a text file....into a dynamic text box. It works great at the root, however, when I try to place the text box inside a nested movie clip that moves around, I can't get the text to show up.

Shouldn't I be able to access a text box with this variable "_level0.text" ANYWHERE by creating a dynamic text box and assigning the variable name to be "_level0.text"?

Here's a partial dump of the output.

Level #0:
Variable _level0.$version = "WIN 6,0,21,0"
Variable _level0.text = "
<b>Master of Science</b>: 1993 - 1996
<font color="#330000">Miami University: Oxford, Ohio</font><br>"
Movie Clip: Target="_level0.menuclip"

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

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

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


thx a lot



Im a newb :P

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

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.

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

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?

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.

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?

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?

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

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?

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?

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!!!

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^^

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

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.

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");

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!!!

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^^

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?

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

Trouble With Dynamic Text Fields
When I put the text into a dynamic text field it looks just fine. But when I test the movie, the text looks very jagged and bad - I guess aliased is the right term here. Why is this happening?? I can't figure it out for the life of me and I need to get this website done. Please help!!!!
Thanks.

Trouble With Dynamic Text Fields
When I put the text into a dynamic text field it looks just fine. But when I test the movie, the text looks very jagged and bad - I guess aliased is the right term here. Why is this happening?? I can't figure it out for the life of me and I need to get this website done. Please help!!!!
Thanks.

More Trouble With Dynamic Text Fields
I'm trying to make only certain lines of a dynamic text field bold. But when I test the movie, ALL of the text is bold. Why? Why? Why?
Please help! Thanks.

More Trouble With Dynamic Text Fields
I'm trying to make only certain lines of a dynamic text field bold by selecting the desired text and clicking the "bold" button in the properties inspector. But when I test the movie, ALL of the text is bold. Why? Why? Why?
Please help! Thanks.

Having Trouble Masking Dynamic Text
Hello all!

I am attempting to mask a dynamic text field which pulls it's value from an asp page. I can get my text field to populate just fine without my mask layer, but once I mask it's layer, I can no longer see my dynamically placed text. Once the mask is removed - whala! My text is back.

Any suggestions??

Thank you in advance!

:o)

Dynamic Text Color Trouble
I am using dynamic text with a scrollbar component, nothing fancy.

My problem is that I want to have different colors of text within one box, but every time I change the color of some text, it will change the color of all of the text.

Any help is greatly appreciated, thanks!

Trouble Loading An Outside Txt Into Dynamic Text
ok

here's my problem

i have outside text in a .txt document and im loading it in a Dynamic text box using "loadVariablesNum"

and it workd fine if the text box is sitting in the main timeline, but if it is inside a movieclip that is on the main timeline... it doesnt work

so in other words

how do i get dynamic text to load the .txt file if the dynamic text box is inside a movie clip that is then on the main timeline?

is it a (_root.loadVariablesNum() ) call? or a _parent. or _global? im at a loss and if that isnt fun enough... how would the code look if the movie clip was in multiple scenes? is there a way to load the .txt and file it for multiple clips to pull the info?

thanks

-c

Dynamic HTML Text Trouble
Hi-

I'm working on site that loads dynamic HTML text from an external file to make it easy to update. I can make it work if the text appears with no animation (see biography.fla in the uploaded file). However, I would like to tween the text and I can't figure out how to swing it. I thought putting the text into a movie clip symbol would solve the problem, but it didn't (see performances.fla in the uploaded file.)

If you have any ideas about how to make it work, please let me know.

thanks,

Andrew

Trouble Reading Dynamic Text
Hi there..

I'm having trouble getting my variables from ASP into my Flash-doc.

I was told to use this code (part of the page with the .swf):

<param name="movie" value="game.swf" />
<param name="quality" value="best" />
<param name="phone" value="54665324" />
<param name="highscore" value="2635" />
<param name="username" value="Peter" />

But I cant get the variables phone, highscore and username into flash.

I'm using:

code: loadVariables("test.asp",0);

And I have 3 dynamic fields named phone, highscore and username.

Can anyone tell me what I'm doing wrong? Flash-file is attached....

Thnx,

[MX04] Trouble With Dynamic Text Box
Hi,

I'm sorry if this is a really basic problem.

Basically, I have 2 input text boxes, that on the press of a button, multiply and the answer comes up in a dynamic text box. That part is all good so far. But what I am having problems with is, when i press the button to cause the calculation (or i can put in another button if it is easier), I want to display certain text in another dynamic text box based on the result of the calculation.

I hope that isn't really confusing... i will paste my little script so far..


on(release) {

bmi_txt.text = Number (weight_txt.text)/ ( Number (height_txt.text)* Number (height_txt.text));

if (bmi_txt.text < 20) {
result.txt_text = 'Underweight';
}

}

Am i missing a refresh line or something...?

hope the question isn't too trivial! Thanks so much for any help...

Trouble With Dynamic Text And OnRollOut
I have this moviclip containing a dynamic textfield. The textfield is set to selectable. The movieclip has an onRollOut event. When i add the onRollOut event to the movieclip i can no longer select the text. Any ideas?

Trouble With Dynamic Text And Array
Last edited by Imm0rtal : 2006-10-17 at 15:14.
























OK, here's my code:


ActionScript Code:
for (x=0; x < _root.port_web_name.length; x++) {
    clipRef = this.attachMovie("listbutton", "listitem"+x, this.getNextHighestDepth());
    clipRef._y = 20*x;
    clipRef.textbox.text = "Your Mom.";
    clipRef.textbox.autoSize = true;
}



Font is embedded, no masking going on, text comes up blank. When I take out "clipRef.textbox.text = "Your Mom" it shows up correctly, but obviously the text isnt being replaced. Is there something I'm missing here?

PS. while I have a topic started, anybody want to comment in on what the best way to tween a letter so that it scales up and covers the entire screen black? I'm using the Tween class but its a bit laggy.

Trouble Writing Text To Dynamic Text Box
I am using Flash MX (6.0). I am trying to display some text in a dynamic textbox. In my first frame a have a routine that imports and parsed a csv file into an array. After completing the array, the playhead goes to frame 2 where I am just trying to assign a value to a dynamic text field. I don't think it should be this difficult. Here is my actionscript. I have also attached the fla. Thanks!

First frame (creating array):
code:
stop();

// Initialize variables and constants
var _fileload = new LoadVars();
var full_array = new Array();
var DIR = "pix/";

// Start the data loading
_fileload.load("csv.txt");

// Functions
_fileload.onData = function(txtfile)
{
var temp1_array = txtfile.split('
');
for (var i = 0; i < temp1_array.length; i++)
{
var temp2_array = temp1_array[i].split(',');
full_array[i] = temp2_array;
}
gotoandplay(2)
};

Second frame (assign part of array to dynamic field):
code:
stop();

// Populate listbox
for ( var i = 0; i < full_array.length; i++)
{
listbox_lb.addItem(full_array[i][0]);
}

// Add some text
title_txt.text = full_array[0][0];

Copyright © 2005-08 www.BigResource.com, All rights reserved