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




Dynamic Sizing Of Dynamic Text Box



Is there any way to have my dynamic text box expand or shrink to fit whatever text is put in it? The problem I run into is having the text cut off if the box isn't physicaly built large enough.

Thanks in advance.

_t



FlashKit > Flash Help > Flash MX
Posted on: 12-05-2003, 11:08 AM


View Complete Forum Thread with Replies

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

Dynamic Text Box Sizing
This may be a dumb thing to say, but that's just me. I write the text I want to display in a box. I make the box dynamic, multiline and unselectable, therefore making much more readable. All the text fits inside the box size I have used.

I then play the movie however, and large chunks of text are missing i.e. the box now appears to be too small to contain the text.

Does anyone know why this would happen? It's incredibly annoying!!!!

Dynamic Text Box Sizing
Hi all...

I'm building a scrolling marquee. Simple enough, but I'm wondering if someone can help me with one aspect of it.

I'm passing several strings of text via php that will scroll by in the marquee. These strings are all different lengths, some short, some very long. I'm populating a dynamic text box inside a movie clip. The problem is, is that I don't know the best way to size this text box. The best way I could think of was to pass the total number of characters in my text to the movie and then do this:

_root.myMovie.myTextBox._width = _root.numChars * 7

7 seems to be the magic number, anything smaller cuts some of the end of the text off. Anything longer gives me too big of a box. I need to get it as close to the size of the actual text as possible, because I'm checking for the end of the text box to go by before I send the next string across the marquee with a duplicateMovieClip function.

Hope this makes sense, if someone has a better way or suggestions, please help! Thanks in advance...

Dynamic Text - Sizing Issue.
I have a dynamic text box which loads an external txt file.
When the movie is published the text in the swf comes up blurry when viewed at %100 but is fine when show all is ticked?

Im using verdana size 9 for the font.

any tips?

Dynamic Text Box Sizing Issue
I have some dynamically generated buttons.
So I made a button, slapped my dynamic text box on it and made the text centered. Problem is the text of the buttons varies in length. So the spacing of the buttons seems really wide between some buttons and too small between others (partly because there's no background to the button, its just the text). Anyway to get around this?
Can I limit the size of the dynamic textbox/button to the length of the text loading into it?? tia.

How Do You All Handle Dynamic Text Sizing?
Hello!
How do you guys handle situations where you have a dynamic text field that needs to have the text size shrink when the length of the text is too long to fit in the spot alloted on the stage?
I usually make a stupid little if/then that sets the size based on the number of chars, is there a cleaner and more elegant solution?
Jason

Dynamic Text - Auto Sizing The Height?
Dear All
I have several dynamic text fields that are going to be in a column. I am going to use these fields with xml files for the user to update. Hence I don't really know how long the text is going to be. I can set a max size by creating a dynmaic text box that has several lines. However, if the user only inserts a few words I am gonig to be left with a lot of empty space a the bottom of the text box.
HOw do I set the text box so that its size automatically adjusts up and down to the size of the text that's going into it.
Many thanks
Edward

Dynamic Txt Box Sizing?
I've made my own txt ticker, and it works well save one problem-

The size of the dynamic text box is static, which is fine if I'm always putting in the same amount of text, but prob is the amount will change. If I make a huge text box, I have to resize for less text, and vice versa. I'm loading the text from an external text file. Is there a way for me to specify the width of the txt box in the external file? Give it an instance and specify that width with a number? I can't seem to get it.

Any help?

Thanks

Dynamic Sizing...
http://www.lechateau.com/Home.aspx

when u resize the browser to smaller, the masthead disappears

can anyone tell me how do i do this?

Dynamic Sizing
I have a movie clip that is just a semi-transparent white and and a dynamic text box. I was using the background in AS to create a white background that was the same size as the text. so when i would update my text, the background for the text would be the right size. however i need the background to be semi-transparent and could not find a way to do that with AS. I could be wrong!!! so i created a background but was wondering if there is a way i can "size" the background to what ever the size of the dynamic text box. so when i update the text the background will be resized... Thanx for any input you can give me... there may be a better or easier way of doing this... please let me know! here is my code.

tryBox -- is my dynamic text box
specBG -- is my semi-trasparent background (which is a movie clip)


ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;

//loadVariablesNum("special.txt", 0);

_root.bgImage.swapDepths(-16382);
trace(tryBox.getDepth());
_root.specBG.swapDepths(-16379);

tryBox.autoSize = true;
//tryBox.backgroundColor = "0xFFFFFF";
tryBox.background = false;
tryBox.border = 0;


var myformat = new TextFormat();
myformat.size = 18;
//_root.myText_txt.setNewTextFormat(myformat);

var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("http://www.muralsyourway.com/FlashHome/slideshow.xml");

myShowXML.onLoad = function() {
    _root.myWidth = myShowXML.firstChild.attributes.width;
    _root.myHeight = myShowXML.firstChild.attributes.height;
    _root.mySpeed = myShowXML.firstChild.attributes.speed;

    _root.myImages = myShowXML.firstChild.childNodes;
    _root.myImagesNo = myImages.length;
    _root.mySpecial = myShowXML.lastChild;
    setChildIndex(myShowXML, 0);
   
    headerTitle.autoSize = true;
    headerTitle.text = _root.mySpecial.attributes.header;
    tryBox.text = _root.mySpecial.attributes.spec;


   
    createContainer();
    callImages();
};


function createContainer() {
    _root.createEmptyMovieClip("myContainer_mc",1);
    _root.myContainer_mc.swapDepths(-16383);

    myContainer_mc.lineStyle(0,0x000000,100);
    myContainer_mc.lineTo(_root.myWidth,0);
    myContainer_mc.lineTo(_root.myWidth,_root.myHeight);
    myContainer_mc.lineTo(0,_root.myHeight);
    myContainer_mc.lineTo(0,0);

    myContainer_mc._x = (Stage.width-myContainer_mc._width)/2;
    myContainer_mc._y = (Stage.height-myContainer_mc._height)/2;
   
}

function callImages() {

    _root.myMCL = new MovieClipLoader();
    _root.myPreloader = new Object();
    _root.myMCL.addListener(_root.myPreloader);

    _root.myClips_array = [];

    _root.myPreloader.onLoadStart = function(target) {
               

        _root.createTextField("myText_txt",_root.getNextHighestDepth(),0,0,100,20);
        _root.myText_txt._x = (Stage.width-_root.myText_txt._width)/2;
        _root.myText_txt._y = (Stage.height-_root.myText_txt._height)/2;
        _root.myText_txt.autoSize = "center";
        _root.myText_txt.textColor = 0x000000;
       

        _root.myText_txt.text = "test";
        _root.myText_txt.setNewTextFormat(myformat);
       
       

    };

    _root.myPreloader.onLoadProgress = function(target) {

        _root.myText_txt.text = "Loading.. "+_root.myClips_array.length+"/"+_root.myImagesNo+" Completed";
    };


    _root.myPreloader.onLoadComplete = function(target) {

        _root.myClips_array.push(target);
        target._alpha = 0;

        if (_root.myClips_array.length == _root.myImagesNo) {

            _root.myText_txt._y = myContainer_mc._y + myContainer_mc._height - 22;
            _root.myText_txt._x = myContainer_mc._x + myContainer_mc._width - 200;
                       
            _root.target_mc = -1;
            moveSlide();
            myShowInt = setInterval(moveSlide, (_root.mySpeed*1000)+1000);


        }
       
    };

    for (i=0; i<_root.myImagesNo; i++) {

        temp_url = _root.myImages[i].attributes.url;
        temp_mc = myContainer_mc.createEmptyMovieClip(i, myContainer_mc.getNextHighestDepth());

        _root.myMCL.loadClip(temp_url,temp_mc);
    }

}


function moveSlide() {

    current_mc = _root.myClips_array[_root.target_mc];
    new Tween(current_mc, "_alpha", Strong.easeIn, 100, 0, 1, true);

    _root.target_mc++;

    if (_root.target_mc>=_root.myImagesNo) {
        _root.target_mc = 0;
    }

    _root.special_txt._y = myContainer_mc._y + myContainer_mc._height - 20;
    _root.special_txt._x = myContainer_mc._x + myContainer_mc._width - 700;
   
    _root.myText_txt.html = true;
    _root.myText_txt.htmlText = "<a href="http://www.muralsyourway.com/myw4-design.cfm?pid="+_root.myImages[target_mc].attributes.path+"">"+_root.myImages[target_mc].attributes.title+"</a>";
    next_mc = _root.myClips_array[_root.target_mc];
    new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);

}

Animated Dynamic Re-sizing Of MC's
I know this can't be hard...But I can't quite get this to actually ANIMATE for me!

THe concept is that I want the user to be able to click a button, and have a bar shrink or grow -- the key here is that I want it to ANIMATE SLOWLY -- based on whatever button they have clicked.

The code I used follows -- but the problem is that it doesn't animate...or if it does, it happens so fast that you can't see it animate.

on (release) {
varBarSize = 300;
curHeight = (_root.red_bar._height);
while (curHeight<=varIncome) {
curHeight = (curHeight + 1);
setProperty(_root.red_bar, _height, curHeight);
}
}


Does anyone know how to slow down the change in height, or another way of doing this?

Ideally I want this to be truly dynamic, so that it could animate up or down based on the number input for varBarSize. So, I'd prefer it not to just reference the frame numbers of a MC.

Thanks in advance!!

The Preloader [ Bar ], Dynamic Sizing,
obviously, i want the length of the preloader bar to change according to the percentage of the movie, as it stands, the first frame checks bytes loaded and so forth and when the movie goes to the second frame it checks to see whether a variable (percentage) has reached 100, and if not goes back to frame one,

in frame one i tried to increase the length of my movie clip (bar) BUT it won't work.

All I really want to know is if anyone knows of a good place to find a tutorial concerning creating a communicative preloader with a loader bar.

Cheers : )

London.

Dynamic Stage Re-sizing
I was wondering if anyone knew if it was possible to dynmically resize the flash stage WITHOUT reloading the swf in the browser.

From what I understand the _height and _width property of the stage is read only, and the only way to change the stage size is by changing the height or width of the < object > and < embed > when the html page is rendered in the browser (which would require reloading).

If I am wrong that would be awesome and solve a few issues that I am having right now (using iframes to reload swf).

Any thoughts???

Gracias

Dynamic Sizing And Positioning
Hi in ammendment to my previous post, i am trying to get this file to work and still can't! my aim is to get the bar that is clicked on to resize to 398px width and make the other bars move accordingly so they fit and they resize to 40px. a the moment i only have the code working to make the bars move. any help would be greatly appreciated!

(mx2004)

Dynamic MC Sizing To Fit Resolution
Hi all

The example is www.kpf.com done by firstborn, the way the feature image scales to fill, then goes back on click. For the love of god does anyone know how to do this...

Dynamic Content Sizing
I am using dynamic text which I am reading with PHP from a mySQL database. I am using load vars and then setting the value of a text field to the data read in. How do I figure out what the height of the text field should be? As of right now I have it as a fixed height and I either have a bunch of room at the bottom, or it cuts off a few lines. For an example of what I mean, the height of the posts in this forum have a varying height which displays exactly all of the data. Thanks for you help in advance.

Sizing Dynamic Images
I am dynamically Loading a .jpg to a Movie Clip. The _mc is 160x130 pixels and the .jpg is 330 x 280.

The problem is this:
loadMovie("data/Image1.jpg", Image1_mc);
works fine but the Image1.jpg doesn't fit inside the Image1_mc

Would there be a better way of importing an image to the Scene and resizing it.

I also want to make a button over effect so that the dynamically loaded image will show in a larger frame when the user wishes to see an enlargement of a thumbnail image.

So far I have used:
_root.Image1_btn.onRollOver = function() {
loadMovie("data/Image1.jpg", Large_mc);
}
But this then reloads Image1.jpg (freshly) into the Large_mc from the dynamic source and again fails to size the image.

BaNa

Dynamic Jpg Loading/sizing Problem
Hi, I'm new here...

I have a movie that a user can load jpgs into by choosing from a list in a select box. I have that working, no problems. They can modify the size, alpha, depth, rotation, etc. and save the jpg's properties to a database. I have that working, too. When I go to reload their jpg to the stage, the alpha, rotation, depth, x & y coords can be recalled with no problems, just as the user left them. However, as soon as I try to set the objects width and height, the jpg disappears. Is this a bug, or am I doing something wrong. It just seems strange that I can set all of the other properties fine, but width and height kill it...

Any help is much appreciated!

Dynamic Image Frame Sizing
Hey gurus,

The specific task i want to tackle is:

Photo boxes dynamically resizing to different image sizes. ie. a photo gallery that has a main image border that resizes to fit different images selected from a nav

Always been a fan of this style of animation and want ot get my head around the coding. Can someone point me in the right direction on either tuts or guidence

MUCH APPRECIATED!

josh

Sizing Dynamic Loaded Images
I am dynamic loading images to a blank mc on stage. Everything works fine with the script I am using. My problem is I am concerned about loading large images to a specific size. I would like all images when loaded to not be more than w 400 or h 300. I have tried setting the mc _width and _height property to those figures using _root.mcLode1._width = 400; ..._height = 300; but when I do this nothing is there. I have tried an if statement; if the width or height is greater than then _xscale-=5;/_yscale -= 5; This kind of worked but only after the picture loaded to large and then was reloaded again and again till it met the test.

Below is the script I am using to load the images:


picture = ["1.jpg", "2.jpg", "3.jpg", "4.jpg"];
MovieClip.prototype.pressMe = function() {
this.onRelease = function() {
_root.mcLode1.loadMovie(this.subNav.text);
_root.mediaTxt.text = this.subNav.text;

};
};

Thanks

Sizing Dynamic Loaded Images
I am dynamic loading images to a blank mc on stage. Everything works fine with the script I am using. My problem is I am concerned about loading large images to a specific size. I would like all images when loaded to not be more than w 400 or h 300. I have tried setting the mc _width and _height property to those figures using _root.mcLode1._width = 400; ..._height = 300; but when I do this nothing is there. I have tried an if statement; if the width or height is greater than then _xscale-=5;/_yscale -= 5; This kind of worked but only after the picture loaded to large and then was reloaded again and again till it met the test.

Below is the script I am using to load the images:


picture = ["1.jpg", "2.jpg", "3.jpg", "4.jpg"];
MovieClip.prototype.pressMe = function() {
this.onRelease = function() {
_root.mcLode1.loadMovie(this.subNav.text);
_root.mediaTxt.text = this.subNav.text;

};
};

Thanks

Dynamic Scroll Pane Sizing
i am loading text from a text file into a movie which in turn loads it into a scroll pane. what i am wondering is if there is a way to allow the whole thing to adjust its sizing ( how much 'scrollable" area there is ) dynamically. the underlying issue is some of these text areas will be changing over time in terms of how much goes in them. make sense ?

Dynamic Movie Sizing (help The Newbie)
hey everyone - i'm been lurking around here for a while - i figure i'm in dire need of help, so now's a good time to pop in.

anyway - here's what's up:
- using flash mx 2004
- i'm making a movie that where you roll over a button, a container containing text appears. this container has 2 pieces: a heading and list under the heading.
- i'm loading the text from a PHP file that is pulling off data from a database. the data looks like: &varHeader1=blah&varContents1=blah1
blah and blah


the &varContents variable is varying in length and i want to be able to resize the container according to how many lines there are. so i figure i have to count how many lines there are in this dynamic contents text box and then set _yscale property of the container accordingly. the only problem is that the container not only moves up when it resizes, but it squishes down as well. how do i just make the bottom of the container come up without the top coming down too?

if you need further clarification, i'll be happy to provide.

thanks for any help you can give me. =)

Dynamic Sizing With Masked Objects
I can't figure out how to do a fullscreen or active resizing with AS3.0 and Masked objects.

I have an animation(timeline) that is say 1500 pixels wide X 500 Pixels high.

I'm masking this item to the stage default size, 500 X 500.

Then I'm trying to Size this mc to 100% stage width, and height onResize.

but it is sizing the MC based on it's unmasked size 1500X500 instead of the 500X500.

since that didn't work, I thought, If I make the mc a separate SWF, at 500X500 then load it into my main stage, then it'll have to work based on 500X500 instead of 1500X500.

This didn't work either.

I don't know what to do? Only alternative I can think of is creating an FLV of my animation, at the actual 500X500 dimension, but that doesn't make sense to me

Let me know what you think.

Richie

Sizing Dynamic Movie Clips
I have a project I am working on that has a scroll window on the main page and the movie clip displayed in it changes. All of the movie clips that get displayed in the scroll window are all dynamically made through actionscript loading all of the info from PERL scripts usingLoadVars().

For some reason I cannot figure out yet there is like a full page worth of empty space at the bottom of each movie clip so as you scroll down once you hit the end of the content it will still scroll down atleast another page worth. Any ideas how I can stop that so the scrolling will stop when the content ends?

Dynamic Sizing Of Hover Captions
Hi all,

I've just been messing around with hover captions and been able to make 4 seperately sized captions appear over different objects, but I'd like to go one step further and have Flash dynamicly size the Image content of the hover caption so that no matter how much multi line text is present the image will always match it.

I've searched the fourum and found things for external images, however this should be much simpler, I'm thinking, define some variables in the text layer and have the image layer reference them completing the resize.

Not sure!?

Anyone have a guess at how it might be done?

Dynamic Window Sizing Question
First off, you really have a great site here. I have been doing a ton of browsing, and have really liked what I have seen, I have been learning a lot.

I have been inspired of late by drawingart.org - which IMHO is a very slick website. But I can't for the life of me figure out how to get that bottom bar stick to the bottom with dynamic sizing, like they do. I use


Code:
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.ACTIVATE, activateHandler);
stage.addEventListener(Event.RESIZE, resizeHandler);

function activateHandler(event:Event):void {
trace("activateHandler: " + event);
}

function resizeHandler(event:Event):void {
trace("resizeHandler: " + event);
trace("stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight);
}
to get the dynamic window.

But how do I get the pesky bar stick to the bottom?

I am working on OS X with Flash CS3.

Anybody care to share a code snippet, or at least point me in the right direction?

--hov

Dynamic Sizing Of Hover Captions
Hi all,

I've just been messing around with hover captions and been able to make 4 seperately sized captions appear over different objects, but I'd like to go one step further and have Flash dynamicly size the Image content of the hover caption so that no matter how much multi line text is present the image will always match it.

I've searched the fourum and found things for external images, however this should be much simpler, I'm thinking, define some variables in the text layer and have the image layer reference them completing the resize.

Not sure!?

Anyone have a guess at how it might be done?

The Dynamic JPGs Loading And Sizing Problem
I want to dynamically load JPGs into a MovieClip by choosing from a list in a select box. The problem is I set width and height of MovieClip is (240,180) but every JPG has different width and height . How do I fix the JPG size into a MovieClip?

Any help would be greatly appreciated. Thanks.

softip

Wierd Dynamic Sizing / Positioning Problem
OK so i wrote some code dynamically rezise and position an mc which is having an image laoded into it using the MovieClipLoader class. All was working fine until i added my re-positioning code. (at least i think it was, i was tinkering around with it still at 4am....) Anywho... now if you load (for example, it does vice verca) a wide image first (width>height) it scales fine (and is centered fine) If you then load a long image (height>width) it centers fine but this time it makes it 11.25 pixels shorter than than it's supposed to be... Which is wierd considering i'm using Math.round before i scale it!

Here is the MovieClipLoader functions (i removed the onLoadProgress, onLoadComplete & onLoadError functions as they make no reference to the target MC and would make this post even longer :P) :


Code:
//create an instance of MovieClipLoader
var myMCL = new MovieClipLoader();
myMCL.onLoadStart = function(targetMC) {
var loadProgress = myMCL.getProgress(targetMC);
//to reset position of target MC
targetMC._y = 20;
targetMC._x = 20;
};
myMCL.onLoadInit = function(targetMC) {
//the size i wish it to be scaled to in 1 axis
var size = 275;

if (targetMC._height>targetMC._width) {

while (targetMC._height>size) {
targetMC._height -= Math.round(targetMC._height/size);
targetMC._width -= Math.round(targetMC._width/size);
}
//repositioning code
var diffx = (size-targetMC._width);
targetMC._x += diffx/2

} else if (targetMC._width>targetMC._height) {


while (targetMC._width>size) {
targetMC._height -= Math.round(targetMC._height/size);
targetMC._width -= Math.round(targetMC._width/size);
}
//repositioning code
var diffy = (size-targetMC._height);
targetMC._y += diffy/2
myTrace("diff is "+diffy);
}

};
it's really annoying because it dosen't seem to affect the positioning, which i thought it would???

please HELP!!!

love you all

x

Quick Question:Dynamic Image Sizing
Sizing Images Dynamically

I have a question about sizing an image as it comes in from the data base into a flash movie. Right now the code is written...


code:

smallPicX = 0;
smallPicY = 0;
smallPicW = 218;
smallPicH = 153;



so an image from the database comes in and sizes to 218w x 153h. However this creates white space above and below or on the sides if the image is not the same proportion. Can the code be written so the shortest pixel dimension is either 218 or 153. This way the image comes into a mask and crops so it fits.

Guessing but can you set a variable to the min image px dimensions then write if/else statement?

I just need to know if it can be done.
Yes or No. Can this be done?

Thanks
Leslie

[F8] Auto-sizing Dynamic Field For Button Use
Hello,

I am working with some simple ActionScript that I just learned from an online tutorial. I am making text buttons using movies and AS instead of converting the text to a button symbol. I'm repeating the script with subtle changes to make each new button. Simple stuff (from what I understand).

Everything works great except that the buttons or text field overlaps and causes the buttons to be accessed in a place where they should not be able to be accessed. The dynamic text field is the right size to accommodate the largest amount of text that I have. If I resize the original text field to fit the smaller text, then the bigger words get cut off. Just to be clear, my buttons are running horizontally.

What I'm trying to find out is if there is script (preferably simple script) I can add to make the dynamic text field resize for each word that is passed into it.

I hope this makes sense.

Here is the script I'm working with:


b1.onRollOver = over;
b1.onRollOut = out;
b1.buttText.buttonText.text = "news";

b2.onRollOver = over;
b2.onRollOut = out;
b2.buttText.buttonText.text = "media";

b3.onRollOver = over;
b3.onRollOut = out;
b3.buttText.buttonText.text = "bio";

b4.onRollOver = over;
b4.onRollOut = out;
b4.buttText.buttonText.text = "contact";

function over() {
this.gotoAndPlay(2)
}

function out() {
this.gotoAndPlay(7)
}


Any help I can get will be greatly appreciated. Thanks.

Dynamic Sizing Of Movies In Browser Window
I've been looking at Jed Wood's tutorial on resizing the flash movie and elements within it according to the size of the browser window, which is really helpful.

I understand that you can prevent resizing by using the Stage.scaleMode = "noScale"; command, but what if I want to resize the stage to the browser window but NOT the elements on it? Is there a way to do this?

Auto Sizing Dynamic Scrolling Content
Hi I am using AMFPHP to populate some scrolling content ...

The problem is my textfields and in general the content doesn't autosize to match the scrolling height ...

I've tried using textfield.autoSize = "true" but it didn't work ...

any tips or suggestions how can I do this ???

thanks

Dynamic Sizing Of Flash Movie In Browser
This question is in regards to the following site, which many of you may be familiar with - http://www.pdk.pl/index_feng.html

Does anyone know how they have dynamically resized the flash piece in this site?. When you click on one of the buttons (for example click on the blue 'What documents do I need' over on the right hand side) the flash piece extends left and right to both edges of the browser (which I can do) but it also extends downwards towards the bottom of the screen and then down past the bottom of the screen bringing the scrollbar into play (unless you're on a giant monitor).

How have they done this?, Can anyone help with this or give me a push in the right direction.

Thanks,
Stephen.

Free Flash Source For Dynamic Slideshow With Automatic Thumnbails And Dynamic Text?
Is there any free flash source for dynamic images slideshow with automatic thumnbails and dynamic text / caption just like the one here:
http://images.businessweek.com/ss/06.../slideshow.htm
or this one:
http://www.clubparis.net/gallery

TIA

Dynamic Vars, Dynamic Paths Using Variables And External Text Files
Hi there,

first off, apologies for the long post, but its a tricky problem to explain... and on my first post too! (sorry )
Im have a bit of bother with flash calling variables from a text file, and using them to make paths to other variables, and to control the amount of time a duplicate clip occurs. The first of these 2 problems is this:

Im loading a text file "content.txt" into _root. (this works fine)
it contains the variables:

webclipcount=2
&webhenry=hello hello
&webbutton01=henry

on the main timeline I have this button

on(press){
sectiontitle="web"
clipcount=webclipcount
}

there is a text box on the main timeline with variable name of bodycopy.

on a clip on the main timeline I have this;

onClipEvent (enterFrame) {
if (num< _parent.clipcount) {
duplicateMovieClip(thebutton, "button"+depth, depth);
this["button"+depth].name = _parent[_parent.sectiontitle+"button"+num];

this gives button01 the name henry- this works.

on the duplicated clip I have these actions:

on(mouseDown){
_parent._parent.bodycopy=_parent._parent[_parent._parent.sectiontitle+this.name]
}

so we end up with a path like:

_parent._parent.bodycopy=_parent._parent.webhenry

and it in turn should make the textbox on the main timeline contain "hello hello"

but it doesnt.

also for the duplicating clip, unless i use:

onClipEvent (enterFrame) {
if (num< 2) {.....
<snip>

it wont work either. it seems neither can be dynamic/ pulled from the text file. (well, i can get them to work!)

If I use direct paths like:

on(mouseDown){
_parent._parent.bodycopy="bloody hell it works!"
}

and

onClipEvent (enterFrame) {
if (num< 2) {.....
<snip>

it works, but not if they are dynamicly set from the txt file...
Anyone care to shed some light onto this? its doing my head in!
thanks in advance or the help.

cheers,

chris

Jumping To Areas Of Dynamic Text, Printing Dynamic Text
hello,

I have a movie clip that loads a .txt file into a dynamic text field. Due to the amount of content in the file a scroller bar is needed in order to view all of it. I want to create buttons that jump to different areas of the dynamic text for easier navigation so the user can go directly to various sections instead of having to use the scroller all the time. What kind of coding would I need to put on the buttons and within the .txt file at the areas I want to jump to?
Also, I would like to give the user the option to print everything within the dynamic text field only, not the surrounding elements in my movie clip. Is that possible?

thanks!

Dynamic Text Not Loading On Server . . . Other Dynamic Text Issues
ok - here's the url

http://www.rongilcreast.com/Test_Site/main.html

when I 'test movie' in Flash, the text comes in. But not now that it's online . . .

2nd problem. I want to add a scrollbar to the textbox, but when I drag the scrollbar onto the textbox, it doesn't snap-to the text box and resize itself.

all the files are here:

http://www.rongilcreast.com/Test_Site/main.fla
http://www.rongilcreast.com/Test_Site/main.swf
http://www.rongilcreast.com/Test_Site/Index.txt

whatamIdoin'wrong?

tia . . .

[AS2] Changing Text In Dynamic Text Field With Dynamic Instance Name
I dont know what I am missing here but what I want to do is change the text inside a dynamic text field via actionscript. the code I am using runs in a loop within a function. Trace is outputting the correct values.


PHP Code:



    for(i=0; i<=4; i++) {
        if(_root["order_"+ q][i] == 0) {
            ["order_"+ i]text = "First";
            trace("first");
        } else if (_root["order_"+ q][i] == 1) {
            ["order_"+ i]text = "Second";
            trace("Second");
        } else if (_root["order_"+ q][i] == 2) {
            ["order_"+ i]text = "Third";
            trace("Third");
        } else if (_root["order_"+ q][i] == 3) {
            ["order_"+ i]text = "Fourth";
            trace("Fourth");
        } else if (_root["order_"+ q][i] == 4) {
            ["order_"+ i]text = "Fifth";
            trace("Fifth");
        }
    } 




basically I want to do this -


PHP Code:



order_0.text = "First"; 




So how can I change this line to work as expected?


PHP Code:



["order_"+ i]text = "First"; 





EDIT- The instance names for the dynamic text fields are set
Thanks

Mouseless, Autoscrolling, Dynamic Tweening, Dynamic Text...
I am having the darndest time finding help on this even though it seems like a common task (ok done venting)

What I need is this:

A dynamic text field (from txt file) that will autoscroll vertically. I know that I can do this by motion tweening a movie clip containing my dynamic text, but heres the thing: this source txt file will be updated daily (daily events). Some days it will be a few lines of txt (no scrolling necessary). Some days it may be 500 or more lines of text. So simply motion tweening my movie clip a fixed speed and distance will not work. I need the scroll speed, text box size, and scroll distance to be dynamic.

Please help us. The hack that made our kiosk made it almost impossible to open, so it takes me forever to open it and i don't want to do that every day... oh, you didn't need to know that, sorry.

An .fla or a tutorial would be a huge help as I am not action script savy, yet.

Thanks in advance!

Dynamic Aligning Input And Dynamic Text Box (flash 5 / 6)
Hi the title says it all really. i need to know how to dynamically align input and dynamic text boxes in (flash 5 / 6) so on a button press the text moves to the left or centred

thanks!

Dynamic Mask For Dynamic Text Won't Working Any Body Pls Help
Im' supposed to make a scrollable gridlike simulation with using MC. Inside that MC there are dynamic text area as cell in which its text will be updated dynamically.

Now i have a strange prob that when i use setMask to mask that grid MC it won't working


I have the MC name 'grid'
above that another MC name 'msk'

code is like tha
grid.setMask("msk");

it only shows the full grid instead of masking area.

Dynamic Text : Dynamic Height (depending On Content)
Hi people.

Im working on a website, and in some part there is a dynamic text space that sets its width depending on the resolution.

But well, I want the text to be sitting downside of my webpage. For this (I guess) I need to set the height of the space to its contents, so that I can use the textspace height as a unit, for putting it to the ground
(myTextSpace.y=stage.StageHeight - myTestSpace.height)

But well, I do not know, if there is any way to set the textspace height to its contents.

I hope I'm clear, thank you.

Dynamic Text Within Dynamic Movie Clip Loops
Ok my predicament. I am trying to create thumbnails, but instead of using pictures as the thumbnails I would like to have text, formatted blah blah for people to select. Now the code I am trying to adapt is fine and dandy to get working with pictures, so I know the part of this code that creates the movie clip is fine. However I cannot seem to dynamically create the text boxes within the movie clips. I need to have them within the movie clips so the opacity will change when they are hovered over.

Code:

currentName = "t"+k
thumbnail_mc.createEmptyMovieClip(currentName, thumbnail_mc.getNextHighestDepth());
thumbnail_mc.currentName.createTextField("text"+cu rrentName, thumbnail_mc.currentName.getNextHighestDepth(), 0, 0, 244, 28)
thumbnail_mc.currentName.text="test"

k will be changing anyway for each time through taht a movie clip is made hence why they will need different names.

Any help...hope this can be understood.

Accessing Dynamic Text Within Dynamic Added Movieclip.
Hi there.

I'm trying to access and change a dynamic text field within a dynamically added movieclip.

This is how I'm trying to accomplish that;


ActionScript Code:
uButton = attachMovie("_button",arr_videos[i][1], ++uDepth);
  uButton._x = uButtonStartX;
  uButton._y = uButtonStartY + uButtonDistance * uDepth  uButton.btn_name.text = "button name";

btn_name is the name of the dyn. textfield.

But this does nothing.. What am I doing wrong?

Thanks for your help

Samuel

Dynamic Text Field Receiving Dynamic Variables...
or something like that . . .

This is my problem: I'm generating _global variables via XML. Each variable represents different types of copy, of varying lengths. For Example:

_global.introduction = xmlDoc_xml.firstChild.firstChild.nodeValue;
_global.body = xmlDoc_xml.firstChild.firstChild.firstChild.nodeVa lue;
_global.summary = xmlDoc_xml.firstChild.firstChild.firstChild.firstC hild.nodeValue;

I want to create ONE text field, with scrolling, that will act as a template to house all types of content. I've assigned a variable that equals "content" to this text field. . . My problem is, I can't get the text field variable (content) to dynamically swap for the global variable (_global.introduction) in order to display the proper content.

This seems simple, but something's not working for me. Any thoughts? . . . BIG thanks in advance!

XML Loading, Dynamic Buttons, Dynamic Text Fields...
My last thread kind of died, I guess, so here's another one that I hope will get me some help; it has an updated FLA attached and what I think to be some better descriptions of my problems... I know I'm totally indebted to whomever will help, but this is an emergency and I need some timely advice.

so here's the FLA, XML, and some sample images: kirupaTest2.zip

1. I pretty much have the enlarged pictures loading I guess, which was my major problem before, but it doesn't matter because I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:

ActionScript Code:
//"this" is the button that was pressed; would return a string ending in//thumberMC_<number of whichever movieclip thumb was clicked>var: testString:String = this; //storing how many characters are in the string above...var: stringNumb:Number = testString.length;//using that value to take off the last string (hopefully the number)var: finalString = testString.charAt(stringNumb);


And that didn't work. (The code above was entered around line 71 in the layer "actions"; it's gone now)


2. An even bigger problem is I have some containers being drawn dynamically from height and width values pulled from an XML file. When I test the code that creates the objects using hard-coded values, it works fine; say if I put 481 in for the width and 375 for the height. But if I try to do it (sort of) dynamically like:


ActionScript Code:
var picHeight:Number = projects[5].bigPics[0].picHeightvar picWidth:Number = projects[5].bigPics[0].picWidth


it gets all screwed up; please try it for yourself in the supplied FLA. It's hard to describe what goes wrong; some things are drawn, and others aren't. I think it's because the objects are trying to draw before they have the data to draw with. This can be seen at lines 129 and 130.


3. Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).

If I can clarify, please let me know.

Dynamic Video Playlist And Dynamic Text Articles
Hi all, hope you can help me..?

I have the task of creating a Dynamic Video Playlist to be incorporated in a FLASH 8/HTML site. The site owner should then be able to upload their recorded videos. The client will be using a low budged camera. I am planning to suggest a video format to the client that will suit me best.

In addition I also need to create a section where text articles will be posted by the site owner.

I am a beginner in Actionscript 2.0, and I have Flash 8 installed in my PC.

Can anyone recommend some FLA source files to get me started, and a tutorial? I've seen some tutorials, but they are either too complicated or don't attend my needs.

Many thanks!

Dynamic Length Of Dynamic Of Text Field?
is it possible to set the length of a dynamic text field so that the text flowed into it fits perfectly.
I need this so that I can get the _width of the movie clip it sits in.

help appreciated guys.

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