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




Dynamically Load Text With CSS?



Is there a way using this method to load the text in dynamically?

http://www.actionscript.org/tutorial...sh/index.shtml

Sandman9



ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 06-23-2005, 07:46 PM


View Complete Forum Thread with Replies

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

Dynamically Load Text In Multiple Text Boxes
Hello:

I have a Flash file where I have multiple dynamic text boxes. I would like to load the variables for these text boxes from one txt file, but I can't seem to get it to work. All it does is load the first variable into the text box.

Is this possible, or do I have to find another way?

Thanks for the help,

Walks With Sky

Dynamically Load Text
i want to load a text file with a scroll bar and i can seem to get the text file to load. does any one have any ideas or is there a tutorial or something where i can get this to work?

Dynamically Load Text
Hi!
I tried to load a some texts from a txt file.. It works if the textBox is normally... but it DOESN'T WORK if it is in a movie clip... could someonbe fix this code so it will work even the textbox is inside of a movie clip??



loadText = new loadVars();
loadText.load("news.txt");
loadText.onLoad = function() {
newsx.text = this.newsx;
updatex.text = this.updatex;
};






thanx.. in advance...


-GM

Load Text Dynamically
i would like to know how to dynamically load text into a flash movie from an external text file or a .xml file.... any help would be great


thanks

Dynamically Load Text ?
is there a way to dynamically load text into a movieclip in Flash from an external file, such as a .doc or .txt file?

I know jpgs can be loaded easily, but can text?

thanks !!!!

Load Pic Or Text Dynamically
Hi all

I just realise that when loading pic using loadmovie and using loadVariables("WedInfo.txt", this) when loading text, they all seems very slow when uploaded to live server. Very difficult to control the time. Wonder if that is the case for everyone, cos it seems to be so much quicker when just hardcode the values in flash rather than getting it dynamically.

Please advice.

Regards
Nancy

Trying To Get Text To Load Dynamically
I've got a dynamic text box on the stage. It's instance name is 'textName'. I'm using External Interface to pull up the user's name from an LMS. Should be simple, but I keep getting the following error that has nothing to do with the LMS:

TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at course_fla::MainTimeline/frame1()

I've got no idea what this means. I've read other threads and they haven't really helped clarify what I've done wrong. Here's my simple code:


Code:
import flash.external.*;

textName.text = ExternalInterface.call("lms.GetValue", "cmi.learner_name");
I appreciate any help you can offer!!!

Need Some Help To Dynamically Load Text ...
You can check the site here.

www.t-aos.com

The News Ticker is dynamically loaded from a txt file.

I want to do the same thing with the news section underneath it. Would anyone know how i could go about doing this ?

It had to be html capable also, so i can link stuff and make the colors different for the title and body of text. Its a pain in the butt to have to open the fla and edit the news through that.

Dynamically Load Text
I'm very new to AS, so this question is quite basic to most, I'm sure. (So this post might have to be rerouted to the "Beginners' Section" ) I'm making a site for a client who wants it so that he can load his own textual content after it's completed.

Is the following way of doing it correct?:
- Name the dynamic content (for ex.) text.txt and put it on the server along with the swf of the main site.
- Use loadVars to load the text.txt into a movie clip.
- use the Scroll() action on the up/down buttons to scroll the text.txt content within a movieclip. (Will this automatically compensate lengthwise within the movieclip for differing text lengths for each update?)
- to update the text, all the client has to do is load a new text file with the new content named text.txt, right?

Am I on the right track? Thanks!

How To Dynamically Load Text
I have seen the following actionscript from gotoandlearn.


Code:

var str:String = " As an airliner that skidded off a runway during a snowstorm Thursday night at Midway Airport remained today in the middle of a Southwest Side street, its fuselage resting atop the crumpled wreckage of a family's car, federal investigators took charge of the accident inquiry.

A 6-year-old boy riding in the car was killed. At least 10 other people—eight on the ground and two on the plane—were injured.

The Cook County medical examiner's office has identified the fatality as Joshua Woods, of the 14200 block of Elkhart Place in Leroy, Ind. He was pronounced dead at 7:45 p.m. at Advocate Christ Medical Center, Oak Lawn, according to a medical examiner's spokeswoman.

Gary Kelly, chief executive of Southwest Airlines, told a news conference in Dallas today that this was the first fatal accident involving a Southwest flight in the carrier's 35-year history.";

var sInt = setInterval(writeIt,1);
var count:Number = 0;
var s:Sound = new Sound();
s.attachSound("type");

function writeIt() {
   if(count == 0) {
      s.start(0,1000);
   }
   theText.text = str.substring(0,count);
   count += 5;
   if(count > str.length) {
      clearInterval(sInt);
      s.stop();
   }
}


I like this effect, but the question is:

Is it possible to replace the contents being sought by var str:String =

Help Me Load Text Dynamically
Ok i appolgise for the way this is structured but im trying to complete a job half finished by someone else.

Basically the way this movie works is

a. Load main 'movie1' with buttons
b. if ButtonClicked ---> load another movie inside 'movie1' ---> 'Loader,
which has the variable name and code to load another SWF witch then loads a text file , 'text1'.

but the way they have built it is bad,it needs to have a seperate SWF file for every seperate txt file, which is dumb.

What i want to do is simple but i cant get it to work,

have 'movie1' button, when clicked set a global variable textToLoad=""; ----> then load the SWF 'Loader.swf' and when loader.swf opens ----> use textToLoad variable to get the name of the text file it will now import.


But i dont know how to do this. so atm i have


movie 1 , set variable


Code:


var textToLoad:String = "";




button


Code:


on (press) {
_root.movie1.textToLoad = "demotext.txt";
loadMovie("loader.swf",holder,"post");
}




Loader.swf


Code:


Style = new TextField.StyleSheet();
Style.load("style.css");
TextHolder.styleSheet = Style;
thisText = new LoadVars();

var textToLoad:String = "tmp";
thisText.load(textToLoad + ".txt");

thisText.onLoad = function(success) {
if (success) {
the_text = this.my_text;
showText(the_text);
}
};
stop();



It all works fine until here

var textToLoad:String = "tmp";

I need to know how to make this variable equal to what im setting it as in the main movie from the button.



Can someone help me out?

Dynamically Load Text From Another Website
I would like to know how to dynamically load text into my Flash file from another website using MX 2004.

My situation is I want to dynamically load the current lottery jackpot information from http://www.wilottery.com/index.asp. I looked at their source and here is the code they appear to use for the text (unless it's loaded through server-side coding...)

<div id="Layer1" style="position:absolute; width:283px; height:12px; z-index:2; left: 539px; top: 83px; font-size: 9pt; font-weight: bold; font-family: Arial;"><span STYLE="color: #0066CC";>Powerball
- $88 Million </span></div>

Please help! I don't even know where to begin.

Dynamically Update And Load Text
Hey guys I was wondering if someone could help me out with this. I want to be able to update a textbox depending on the date thats in either xml file or text file. Most of the time its weekly that it needs to be updated. this is usually the text that would go in it:

FC Dallas vs. Columbus Crew - June 3, 2006
Join us June 3rd at Pizza Hut Park for some good times as FC Dallas plays Columbus Crew. Game time is 7:30pm Central. The tailgate will start at the Dr. Pepper Victory Pavilion just north of the stadium around 4:00pm or so.

COME EARLY. WEAR RED. STAY LATE.

Click here for more info (this is a link to the forum section where there is more info in regards to a game.)

How Do I Load Text Into A Dynamically Scroling Text Box?
I did a search but there are to many posts and the search stops on me. So I tried to narrow it down, but I get no info.

I need to load some text from a flat file (or from a database) into my Flash app.

How do I do this?

thanks

How Do I Load Text Into My Dynamically Created Textfields?
Hi again Flashgurus!

I'm using the following code to create a function that creates a dynamic textfield:

function makeText() {
createTextfield("textBox", 50, 4, 3, 371, 43);
textBox.background = true;
textBox.border = true;
textBox.backgroundColor = 0xFFFFFF;
textBox.borderColor = 0x000000;
textBox.multiline = true;
textBox.wordWrap = true;
textBox.autoSize = true;
textBox.variable = "txt";

// formatering
myFormat = new TextFormat();
myFormat.font = "Impact";
myFormat.size = 15;
myFormat.color = 0x666666;

textBox.setNewTextFormat(myFormat);
}


In my different movieclips I call the function like this:


_root.makeText(this);


and the textfield, "textBox" , with the variable "txt" is created.

As there are different texts to be loaded in different textfields (in different movieclips that are loaded by a random script), I can't use the function "makeText" to load the texts. I must load the right, specific text in the right, specific movieclip when that movieclip is loaded (and the textfield is created, ofcourse).

So here's the question:
How do I load text into "textBox" from my external textfiles?!

I know how this works when I make textfields manually, but now I'm stuck. As I'm using about 40 different movieclips and I want to be able to change the formatting of the textbox I really want to use my function.

Please help me, oh, You FlashGurus!

Can I Reference A Mc In The Dynamically Load Text File?
I can load text but not align pictures. Also, how can I reference a mc to load into the scroller (text file)?

Can I Dynamically Load File With Text & Images?
Hi there
I have a file with text, an image half way down the page where the text just wraps around it. Can I load all the file into a dynamic text box? Or do i have to split the file up into a main paragraph, middle paragraph & image and reassemble it all then on the stage?
Have never loaded text before so any hep would be greatly appreciated

Dynamically Load Text Into Movie Instance
I have looked all over for a way to do this and can't seem to find one.

I have a movie clip with a text box in it. I want to place three instances of this movie clip on a web page and have each instance have different text in the text box. The instances are menu choices, so I want each on them to open a new web page.

My question is, how can I dynamically load different tet into each instances text box.
P.S. I am fairly new to flash.

Dynamically Load Files Into A Scrolling Text Box
I am currently developing a website and need to construct a text box that loads files that will be available for external download, into the scrolling box. Can this be done??

Using Dynamically Loaded Text To Load An XML File
Hi, I would like to use the text loaded into a dynamic text field to act as the filename of a XML file I'd like to load. If someone could point me in the right direction here that would be great.

Cheers,

Jonahholliday

AS Prob ... Dynamically Loaded Text Won't Load
Hello Everyone,

I have been working on a basic flash site as my first crack at it ... Well, I get an error while trying to preview my .fla and this is what I get:

**Warning** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: The identifier 'loadVars' will not resolve to built-in object 'LoadVars' at runtime.
loadText = new loadVars();

Total ActionScript Errors: 1 Reported Errors: 1

That is the message I recieve when trying to preview it, to say the least ... I'm stuck on this problem . Can someone please help me out with this one? I followed a tutorial from www.kirupa.com called "Scrolling Dynamically Loaded Text". If it helps I'm using Flash MX Pro 2004.

Another Question I wanted to ask is, ... Does every Flash Developer use Adobe Photoshop ?

Thanks in advance for any help!

Create Textfield And Load Text Dynamically ... Why Does Not This Work?
Hi Flashgurus!

I've written a function on the first frame of my movie. Like this:

--------------------------------
function makeText() {
createTextfield("textBox", 2, 4, 3, 371, 43);
textBox.background = true;
textBox.border = true;
textBox.backgroundColor = 0xFFFFFF;
textBox.borderColor = 0x000000;
textBox.multiline = true;
textBox.wordWrap = true;
textBox.autoSize = true;
textBox.variable = "txt";
// formatering
myFormat = new TextFormat();
myFormat.font = "Impact";
myFormat.size = 15;
myFormat.color = 0x666666;

textBox.setNewTextFormat(myFormat);
}
--------------------------------

I made this function to make it simple to edit the formating of the textfields I want to create.

In my movie I load different MC:s using a random script. In every MC I load, I call the function in the first frame:

--------------------------------
_root.makeText(this);
--------------------------------

And the textfield is created, it works ...

Now I want to put text in my textfields:
The different MC:s I load contains an empty MC (controller)that is supposed to load texts from an external textfile, dynamically, and put the text in the textfield created with my function. The empty MC has the following code

--------------------------------
onClipEvent (load) {
this.loadVariables("texts/1.txt");
}
onClipEvent (data) {
_parent.txt = intro;
}
--------------------------------

This thing does not work. It works perfect when I create the textfield manually, but as there are about 40 MC:s I'd really like to use a function to create the textfields.

I surely cannot see where the fault is. I've tried to put the controller in a frame after the textfield is created, in the frame before the textfield is created, but nothing works. The textfield is created but the text does not get loaded. I can't understad why it works when I create the textfield manually and not with this function.

I'm afraid the answer is simple, but I cannot figure it out ...

Can YOU help me? Please ...

Dynamically Load Jpgs From Text File When Button Pressed
I have several buttons that each have a instance name. How can I load when I press a button load the right image dynamically into a mc.
I would like to define all my jpgs in a txt file.

example:
instance name jpg
1 450.jpg
2 122.jpg
3 542.jpg
...

Dynamically Load Data Into Dynamically Loaded Swf?
hi,

i have 2 swfs, 1.swf and 2.swf.

2.swf will be loaded into 1.swf using loadMovie(). but there is some data that is dynamically loaded into 2.swf when it's played.

these data get loaded successfuly when i play 2.swf individually. but when i play 1.swf and load 2.swf into 1.swf, the data supposed to be loaded into 2.swf are not loaded.

can somebody give me some leads?

thanks

Can You Load Scrolling Text Dynamically Without "hard-coding" It?
I made a post about this already but the tutorial someone gave me saw for "hard-coding" text to scroll.

I was wondering if there is a way to scroll text that has been loaded into a dynamic text field.

I have this so far

loadVariablesNum("file.txt",0);

I need to know how to make that file.txt file scroll up and down so all that needs to be changed is the txt file itself and nothing else so it can update on the site.

Thanks in advance to anyone that can help me out with this proble.

[F8] Dynamically Load SWFs And After Load, Resize
Hi there

So as a further step of my simple flash eBook i need to scale my dynamically laded SWFs(They are large converted pdf pages). So far, after i have loaded the 2 first pages i correct the x and yscale property of my containers(i have 2(holderOne and holderTwo), each displaying one page) and that works.

But, if i define a ._width and ._height to my 2 containers(now holding page1 and 2) they both just disappear from my stage. My trace tells me that they are loaded correctly, but they are not there.

Here's the onLoadComplete function in which i specify the size of my containers:


Quote:




preload.onLoadComplete = function(targetMC) {
holderOne._visible = true;
holderTwo._visible = true;
holderOne._xscale = 75;
holderTwo._xscale = 75;
holderOne._yscale = 60;
holderTwo._yscale = 60;
bar._visible = false;
pText._visible = false;
trace(targetMC+" finished");
};






As mentioned the above works, but if i use the ._height and ._width properties (400x500 on each page) on holderOne and holderTwo it does not (or maybe it does but my pages disappear).

Anyone who has a clue about what's happening?

Thx in advance

Dynamically Masking Dynamically Created Text (MX)
I am having trouble dynamically masking dynamically created text... It just doesn't seem to work!! This is what i'm doing.

First i create a movie clip dynamically using attachMovie. On the first frame of that mci create a bunch of text fields, one after the other. When that finishes, i call a function in another mc that creates another mc and draws a box in it and then sets it as the mask of the first mc.

The result should be that only the text that is within that mask should show up, right? Well, the text doesn't mask at all, even if it is entirely beyond the bounds of the mask.

I read that it might be a problem with fonts that aren't embedded, so i set the TextFormat.embedFonts to true...


anyone have any idea??

Is It Possible To Dynamically Load A Jpg Into An Swf?
Would be very grateful if anyone has any idaes on this.

Basically, I'm using variables to load an external text file, which is easy enough. I also want to do the same with a jpg. I know that it's possible to do usung xml if the image is an swf, but the images are being generated by a content management sysytem that can only produce jpg, gif, or png....

Hope this explains what i'm trying to do!

Cheers

Load JPG Dynamically
I've searched all over internet and here at Flashkit to find out how to load dynamically a JPG file into a MC and apply alpha effect to it. I have 20 pics and I need to load one by one, show pic for a few seconds, fade out pic, load next.

Someone could help me please ?

Do I make myself clear?????

Thanks

Dynamically Load .asp
I want to make a flash interface for a website. The products, descriptions, and all other items are stored in an MS Access Database linked to the site via asp. How can I get the Access Database items to load into my Flash Interface?

Load Dynamically.
Hi there.

I want to load an image into a certain movie clip on release of a button.
Can u please help!

Thanks.

How Do U Dynamically Load A Jpg?
I'm having problems trying to dynamically load a jpg, here's the code i'm using:


Code:
var theImg = this.attachMovie("adHolder", "adHolderW", 2);
theImg.loadMovie("cp_crazypets.jpg");
The adHolder movieClip attaches it's self to the stage, but the jpg never loads. Any ideas?

How Do U Dynamically Load A .swf?
I have a swf that I use to load other swf's (mostly games). The problem is the games being load vary in size. I can pass any parameter to the loader swf but the problem is, how do I resize the loader swf based on the game being loaded?
Can the stage of a flash movie be changed at runtime?

here is the code i'm using to load the games

Code:
public function loadBackground(gameURL) {

var L:Loader = new Loader();
var urlReq:URLRequest = new URLRequest(gameURL);
L.load(urlReq);
addChild(L);

}
with php i can change the width and height parameters of the loader, but that just stretches it.

Any ideas? Please help!

How Do You Dynamically Load A Swf?
I have a movie that needs to load in a swf from the server and place it on the stage. I can do this no problem in AS2, but does anybody know how to dynamically load a swf into a movie in AS3?

Dynamically Load .jpg In MX?
I have heard that in Flash MX, .jpg files can be loaded at runime, without having to place them in a movieclip. This could be very useful, making it so that all you need to do to update your site's pics is change their file names, or even better do it using a parameter file.

I have been fooling around with it, and looking through the forums, but can't seem to find anything. Anyone able to help me?

Regards,

______________________________________
Keep On Coding!!
If my post helped you, please give me a star.
If your post helps me, I'll give you one!

Lumstar

Load Variables Dynamically
I'm attempting to load variables (text files) into one movie clip by clicking on a button in another movie clip. Anyone have any suggestions? All I've been able to locate is the loadVariables actionscript, which doesn't seem to work without something else...?

Any help would be appreciated.

Thanx,
-Paul

Dynamically Load Jpg Names
Really wierd bug:

I can't dynamically load an image if it's filename is alpha rather then numbers.

loads fine:
http://images.lisaandbrian.com/cgi-b...1191530572.jpg

doesn't load:
http://images.lisaandbrian.com/cgi-b.../fl_family.jpg

very wierd. thoughts??

How Can Load The Images Dynamically
How can i use the dynamic image in my movie. In the whats new setion of flash mx these guys are telling that now we can load the image dynamically but they havent provide any tutorial for this.
PLease tell me how to do this.

cheers
Ritesh

Dynamically Load Jpegs
Is it possible to dynamically load jpegs from a text file? Thanks

Dynamically Load Images
this may OR may not sound difficult but
if anyone has a link to a tutorial on
loading images dynamically to a flash
movie I would appreciate the direction.

The general problem is this;

To have a menu for images and as is obvious
after a link is pressed on the menu, the image loads,
BUT,
If the owner of the site wants to add new images
daily, then, all he would have to do is upload
the images to the server and the Menu would be updated
and the pic along with the menu item would be accessable.

About the menu, I am going to take care of that myself,
About the images, I will direct the owner of the site
to specifically name each new pic that he uploads,
so that Flash can go through the file each time it loads
and determine if there is another image in the file,
basically it would just loop once and count the number of images. so again, that is not my problem,

the problem is simply loading the data remotely...

Thanks in Advanced everyone

Load Images Dynamically
pls can someone tell me how i can upload images dynamically & also to have a motion for each image i upload.
is there a tutorial which i can go through as well

thanks

Dimuth

Dynamically Load Jpegs?
Is it possible to dynamically load jpeg images into your swf movies?

I'm working on a shopping cart and would like to be able to load images of various products on demand. I'm using Flash 5, and can't find anything that allows this so far. The closest I can get is to create a small swf file with an image statically embedded in it, and then use the loadMovie() actionscript function...

This is obviously not a viable solution for a shopping cart application where an administrator of the store uploads new pictures of various products on a regular basis.

Is It Possible To Load Gif Images Dynamically...?
Hi...
Can any one tell me if I can load gif files dynamically from a folder?

Dynamically Load Swfs?
Here's a problem for ya: I am building a flash site for a friend. She wants it to be "jello" -- that is, expand or contract as necessary to fill the browser window in whatever screen resolution a user may have. Is there a way to dynamically load MCs to do this? The attached file is the "frame" of the site. Across the blue background there will be three more MCs yet to be built: two for either side and one for the center. It's plenty wide and tall now, but not at some resolutions. Complicating this already complicated problem is the banner and footer, both of which would have to orient themselves to the top and bottom of the screen and stretch out or contract as necessary to fill the browser. And there is a background MC that changes alpha. Sure, I could solve this somewhat by putting the elements in a table (controlling the alpha with js) but then I would lose the nice repositioning effect of the logo (unless I packed my brain with more AS than would be safe to know). Is there any answer to this hare-brained scheme? KD

Can I Dynamically Load A .jpg Using WildCards?
This is my current, working, code that loads the .jpg:

_root.myHolder.loadMovie(_root.imageloaded+".jpg") ;

But what i want to do is have it load (_root.imageloaded+"*****.jpg"). So the filename of the jpg would be something like 07House.jpg, or 04VashonIsland.jpg... How would i do this.

Dynamically Load/Unload MC's
Okay, I'm trying to dynamically load movies based on a global variable. This variable is set by some AS that sets _global.whichnav to the buttonNbr that is active. However, the code below doesn't work. Can anyone see a glitch? Ill post the swf in a few minutes.

code:
if (this.state == 3){
switch (_global.whichnav) {

case 0:
_root.container.loadMovie("testermain1.swf");
break;

case 1:
_root.container.loadMovie("testermain2.swf");
break;

case 2:
_root.container.loadMovie("testermain3.swf");
break;

case 3:
_root.container.loadMovie("testermain4.swf");
break;

case 4:
_root.container.loadMovie("testermain5.swf");
break;

}
}


SITE

Also, I was wondering what to do with the MC's that aren't being used, how to store them until they're next accessed or whatever. Any tips?

Thanks,
DaVuLf

How To Load Image Dynamically
Hi!


I want to load image dynamically(externaly), while loading i want to show loading progress bar to percentage of loading....


and also i want to know that when the image will be downloaded, will that image go to user's cache or not... I mean if user come back again and same swf calls, will now swf load images from zero point....???





Thanks,
Erphan B Rajput.

Dynamically Load Image Into Mc
i would like to dynamically load an image into my movieclip at runtime.

how do i pass in a parameter to the movieclip to tell it what image to load?

how do i then show the image within the movieclip?

thanks!

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