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








Problem Loading Text Into Level Using Loadvars


I'm trying to accomplish somthing that in theory is very simple. I have a master.swf that contian a loadvars like so:

Code:
var myLV:LoadVars = new LoadVars();

myLV.onLoad = function(success) {
if(success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading the requested text message. Please contact the webmaster to report your error.";
}
}
Then I have a content.swf with a dynamic text field with the instance name of "loadedInfo" and this simple piece of code:

Code:
stop();
_level0.myLV.load("vars/mainTxt.txt");
Then I simply load that back into the master.swf using this:

Code:
//frame 01
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListner:Object = new Object();

myMCL.addListener(myListener);

//fram 03
stop();
myMCL.loadClip("contentMain.swf", 5)
And that should be about all the code involved. Thing is I can see the graphics from the contentMain.swf file on the stage so I know it gets loaded. Also if I change the myLV var to level 0 and place a text field in the master.swf it works just fine loading the same text file into that. I've probably missed something minor here and I would very much appriciate some help. thx.




FlashKit > Flash Help > Flash ActionScript
Posted on: 01-30-2006, 04:59 PM


View Complete Forum Thread with Replies

Sponsored Links:

Loading Dynamic Text Onto Another Level..?
With the help of Kode, I have figured out how to randomly load and fade in poems from text files. Only, after trying to add additional functionality, namely, an index from which visitors may choose a poem to load, I have run into problems. To put it simply, I can't figure out how to modify the code he provided to load text onto lvl0 so far. Here's some sample code I placed on the first button, which is an mc inside an mc (and that mc is placed on the stage, which is a separate swf loaded on an upper level by lvl0):




Code:

on (release){

var poem = new LoadVars();

poem.onLoad = function(ok) {

if (ok != false) {

this.onData = function(src) {

if (src != undefined) {

_level0.poembox._alpha = 0;

_level0.poembox.text = src;

fadeIn(5);

} else {

_level0.poembox.text = "Error.";

}

};

this.load("poem01.txt");

} else {

_level0.poembox.text = "Error loading file.";

}

};

}


Here's the url for the files required: http://home.comcast.net/~peachsnowfalling/poemindex.rar.. Main.swf is the main site, which provides a button labeled "INDEX". PoemIndex.fla is the source for the swf loaded when the user clicks the INDEX button. "mcButtons" holds all the buttons for each individual poem (wish I didn't have to hard code all of it), and I've also provided "poem1.txt", for testing purposes. If someone can pleasehelp me with this I'd be eternally grateful! I've tried contacting Kode a number of times as he's the one who helped me originally, with no luck. Too bad I don't have his e-mail



Cheers,



The Red Fall

View Replies !    View Related
[F8] Loading Different Text In Different Textfields With Same LoadVars
Hi everyone! I've been stuck with this for a couple of days now and I give up! I'm either blind or stupid...

I load different external text files into different moviclips with a dynamic textfield in them. I apply the same css to them and then load the text. Since I'm doing this through out my project I thought I make a nifty little function to use over and over again. This is how faar I got:

Code:
// function defining mcName
function init(){
var mcName:MovieClip = useThis;
}

// function to load external text in a specific textbox and applying css styles
function getMyStyles(txtURL:String, useThis:MovieClip) {
// get the var mvName into this function
init();
// set the value of mcName
set ("mcName",useThis);

// load stylesheet
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.onLoad = function(success:Boolean) {
// if it works applt css to the text box
if (success) {
_root.mcName.ort.styleSheet = cssStyles;
//load text content into textbox - see function below
getContent(txtURL);

} else {
// error message
_root.mcName.ort.text = "There has been an error loading the required information.";
}
};
// load the StyleSheet
cssStyles.load("styles/styles.css");
}

// load external text to the textbox. A variabel tells whichtextto get
function getContent(txtURL:String) {

// create LoadVariables
var nameLV:LoadVars = new LoadVars();

nameLV.onLoad = function(success){
if(success){
_root.mcName.ort.htmlText = nameLV.info;
} else {
_root.mcName.ort.htmlText = "There has been an error loading the text.";
}
}
nameLV.load(txtURL);
trace("it works!");
}

// load first text into first movieclip with textbox named "ort"
getMyStyles("vars/datum/test01.txt", mc_ort01);

// load second text into second movieclip with textbox named "ort".
getMyStyles("vars/datum/test02.txt", mc_datum01);
As I have assigned the same instance name for the text fileds in the different movieclips only one text will show. But at least something shows. So - I changed the instance names in the movieclips and declared a variable to specify the instance name ofthe text field. see Code below. Now nothing shows... And I can't figure out why! Please anyone??!!!!

Snowgirl with melting brain...


Code:
// function defining mcName and text field
function init(){
var mcName:MovieClip = useThis;
var mcNameIt = useThat;
}

// function to load external text in a specific textbox and applying css styles
function getMyStyles(txtURL:String, useThis:MovieClip, useThat) {
// get the var mvName into this function
init();
// set the value of mcName and text field
set ("mcName",useThis);
set ("mcNameIt",useThat);

// load stylesheet
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.onLoad = function(success:Boolean) {
// if it works apply css to the text box
if (success) {
_root.mcName.useThat.styleSheet = cssStyles;
//load text content into textbox - see function below
getContent(txtURL);

} else {
// error message
_root.mcName.useThat.text = "There has been an error loading the required information.";
}
};
// load the StyleSheet
cssStyles.load("styles/styles.css");
}

// load external text to the textbox. A variabel tells which text to get
function getContent(txtURL:String) {

// create LoadVariables
var nameLV:LoadVars = new LoadVars();

nameLV.onLoad = function(success){
if(success){
_root.mcName.useThat.htmlText = nameLV.info;
} else {
_root.mcName.useThat.htmlText = "There has been an error loading the text.";
}
}
nameLV.load(txtURL);
trace("it works!");
}
// load first text into first movieclip with textbox named with value of "useThat"
getMyStyles("vars/datum/test01.txt", mc_ort01, ort);

// load second text into second movieclip with textbox named with value of "useThat"
getMyStyles("vars/datum/test02.txt", mc_datum01,datum);

View Replies !    View Related
Dynamically Loading 2 Text Fields To 1 Level..
Hi..

Im trying to dynamically load 2 html text fields (from notepad) into the same level (_level0) in a website in Flash 8. How can i do this? What i know of levels is that one level will 'cover' the other levels when loaded if its on a higher level, yet what i want is to have a few textfields on the same page (_level0) of the site that are loaded in dynamically, so i can have a 'news' section 'latest projects' section etc.. on the home page before the user starts exploring the site. Anybody know how to do this?

Thanks in advance....

View Replies !    View Related
Loading HTML True Text With PHP And LoadVars
I've got a small custom "blog" set up.

An input field sends text to the db w/ PHP and a dynamic text field is SUPPOSED to pull all the text from that column of my db Table.

It works when I run the PHP file in the browser, but Flash can't seem to see it. I've tried sending it back to Flash as a name=value pair, and as a straight echo, but neither seems to work.

I have a feeling the problem is my code is too simple to deal with multiple values for one loadVar.

Here's the PHP code that calls the db and pulls all the entries from the column 'blogBody' in the table 'blogText'


PHP Code:



<?$user = 'simplec_admin';$password = 'eugene';$database = 'simplec_blog';mysql_connect('mysql12.ixwebhosting.com', $user, $password);mysql_select_db($database);$query = 'SELECT * FROM blogText';$blogQuery = mysql_query($query) or die('error');//$display = mysql_fetch_array($blogBody) or die('error2');while($blogDisplay = mysql_fetch_array($blogQuery)){echo $blogDisplay['blogBody'];echo "<br>";}?>




Here's my Actionscript that pulls the text from the PHP file and puts it in a dynamic text field:


Code:
var blogIn:LoadVars = new LoadVars();
var blogOut:LoadVars = new LoadVars();

blogIn.load("blogIn.php",_blank);

blogIn.onLoad = function (success) {
if(success){
blogField.text = blogIn.blogDisplay;
}else{
blogField.text = 'Error loading from Database';
}
};

Thanks a ton! x-posted in ACTIONSCRIPT 2.0

View Replies !    View Related
Loading HTML True Text With PHP And LoadVars
I've got a small custom "blog" set up.

An input field sends text to the db w/ PHP and a dynamic text field is SUPPOSED to pull all the text from that column of my db Table.

It works when I run the PHP file in the browser, but Flash can't seem to see it. I've tried sending it back to Flash as a name=value pair, and as a straight echo, but neither seems to work.

I have a feeling the problem is my code is too simple to deal with multiple values for one loadVar.

Here's the PHP code that calls the db and pulls all the entries from the column 'blogBody' in the table 'blogText'


PHP Code:



<?$user = 'simplec_admin';$password = 'eugene';$database = 'simplec_blog';mysql_connect('mysql12.ixwebhosting.com', $user, $password);mysql_select_db($database);$query = 'SELECT * FROM blogText';$blogQuery = mysql_query($query) or die('error');//$display = mysql_fetch_array($blogBody) or die('error2');while($blogDisplay = mysql_fetch_array($blogQuery)){echo $blogDisplay['blogBody'];echo "<br>";}?>




Here's my Actionscript that pulls the text from the PHP file and puts it in a dynamic text field:


Code:
var blogIn:LoadVars = new LoadVars();
var blogOut:LoadVars = new LoadVars();

blogIn.load("blogIn.php",_blank);

blogIn.onLoad = function (success) {
if(success){
blogField.text = blogIn.blogDisplay;
}else{
blogField.text = 'Error loading from Database';
}
};

Thanks a ton! x-posted in GENERAL QUESTIONS

View Replies !    View Related
Change Font, Color Etc When Loading Text Using Loadvars?
Hello

How do I change the font, color, bold etc, when I loaded my text from a textfile using the loadvars:
code:
text1 = new LoadVars();
text1.onLoad = onText;
text1.load("sometext.txt");
function onText() {
_root.b1.k1.text = text1.sometext;
}


Normally I would use this:
code:
_root.b1.k1.mytext = new TextFormat();
_root.b1.k1.mytext.color = 0xECB700;
_root.b1.k1.mytext.font = "Futura";
_root.b1.k1.mytext.size = 30;
etc


Any ideas?

Regards
Michael

View Replies !    View Related
LoadVars - Text File Loading Multiple Entries
Hi there,

I've been looking for a solution to my prob on the forums but none are quite right. i'm trying to load multiple entries from a text file one after the other into a text box using the LoadVars() command.

This script below currently loads the last entry from the text file - i'm falling down with the looping script. My text file structure is this:

content=start&
id=1&title=Entry one&body=Body Text Updated Test test&date=8/14/06 12:00 AM&
id=2&title=test of new story&body=This is a bit of a new story&date=9/1/06 4:38 PM&
content=end&

i'm unsure if i need to make an array and use the 'id' parameter to identify the entry. I'd really appreciate some help. Thanks
Heres my script:

myData = new LoadVars();
// define callback for onLoad event
myData.onLoad = function(success) {
if (success) {
date = this.date;
title = this.title;
body = this.body;
id = this.id;
//populate text field
myBody_txt.htmlText = date+"<br>"+title+"<br>"+body+"<br>"+id;
} else {
// what to do in case of data error
myBody_txt.htmlText = "<b>Error loading Data</b>";
}
};
// now load the text file
myData.load("myText.txt");
stop();

View Replies !    View Related
LoadVars - Text File Loading Multiple Entries
Hi there,

I've been looking for a solution to my prob on the forums but none are quite right. i'm trying to load multiple entries from a text file one after the other into a text box using the LoadVars() command.

This script below currently loads the last entry from the text file - i'm falling down with the looping script. My text file structure is this:

content=start&
id=1&title=Entry one&body=Body Text Updated Test test&date=8/14/06 12:00 AM&
id=2&title=test of new story&body=This is a bit of a new story&date=9/1/06 4:38 PM&
content=end&

i'm unsure if i need to make an array and use the 'id' parameter to identify the entry. I'd really appreciate some help. Thanks
Heres my script:

myData = new LoadVars();
// define callback for onLoad event
myData.onLoad = function(success) {
if (success) {
date = this.date;
title = this.title;
body = this.body;
id = this.id;
//populate text field
myBody_txt.htmlText = date+"<br>"+title+"<br>"+body+"<br>"+id;
} else {
// what to do in case of data error
myBody_txt.htmlText = "<b>Error loading Data</b>";
}
};
// now load the text file
myData.load("myText.txt");
stop();

View Replies !    View Related
[MX04] Dynamic Text Not Loading. LoadVars() Or Pathing Issue?
Hello FK community,

Congrats to the one who can figure out my problem, because I bet a few others out there are designing pages in the same format that I am (in levels). I'll visually explain below my Heirarchy:

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

- StartHere2_RScom.fla (MASTER - calls "layout_2.swf" to level 500)

- layout_2.fla (template w/ active buttons NEEDED in the foreground)

- bg_resume.fla (an .swf called from "layout_2.swf" into level 20 - loadVars() Dynamic Text being called HERE)

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

So here's my issue (please feel free to throw somethin' at me if my format is improperly laid out). Because I need "layout_2.fla" in the highest level with all other pages active behind it for animation and design purposes, I decided to build all my separate pages into levels via loadMovieNum and unloadMovieNum to clear the page when a viewer clicks on other buttons from "layout_2.swf".

I have dynamic text contained in bg_resume.fla that isn't showing, even though the scroller and other items are. I'm calling a .txt file within my loadVars() code. When I run the bg_resume.swf file itself I see my text. However (pathing issue?), When I open my project from the top how a viewer would on my page, StartHere2_RScom.swf, I see no text. Being that I have other pages called from "layout_2.swf" using dynamic text, I need to make sure that a solution is for the overall formatting of my site.

NOTES: Linkage on text is correct. I tried also copying the loadVars() code to the first frame of StartHere2_RScom.fla, but that didn't work either. Text files are also in the same directory as all of my .fla & .swf files.

If anyone out there could please help me out with this, I'd be forever in debt to you. Being that this is my first ever post, I tried not to post by putting in many hours of research on the boards here to see if this was posted elsewhere so that I wouldn't inconvenience anyone. I have files here if anyone needs to see my code.

Again, thank you so very much in advance. ...lookin' forward to contributing to FK in the future. Take Care.

View Replies !    View Related
Help With Loading Text File (loadvars). Works In Pc But No In Internet [NOT SOLVED]
Hey guys
I have this script in my flash


Code:
on (release) {

loadText = new LoadVars();
loadText.load("http://www.djgdevelop.com/cgl/templates/cgl/images/map/LAX.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
_parent.newsBox.html = true;
_parent.newsBox.htmlText = this.myNews;
}
};
}
It loads a small text with this info:
[HTML]myNews=<font size="16px" color="#FFFFFF"><b>Tampa, FL</b></font>
<b>(ATL)</b>
402 East Oak Avenue Suite 204 Tampa, FL 33602-2704
T. 813.221.5060 F. 813.221.[/HTML]


Everything works fine in my pc, I change the URL and stuff and nothing, the server is just "reading'. Both files are together in the same folder.

What should I do? Thank you in advance

View Replies !    View Related
Tweening Textfield With Embed Fonts And Loading Text Through LoadVars
Hi guys,
I am gonna ask the same question again regarding tweening in text fields.
I already read some Adobe documentation and I understood that text field has its property _alpha available just when it HAS embed FONTS,
So I supose if I want apply a tween class on a text field, I HAVE to have a embed font aplied in this text field... well, for now it is ok, because I did some experiments and everything worked good, but I need to use LoadVars to load my text from external file, and that is my deal.
Does anydoby know something regarding this issue, because I already tried a text fiels with TextFormat class aplied, and embed Fonts, but when I try to load my text from an external file, nothing happen !
You guys can check this site below and notice that thet ext field has a tween class aplied in "About Us", "Testimonials", "Pricing" and "Contact US"...

Do you guys think that they did not use a external text file for this option ?
Just writing all text directly in TextField.text propriety instead a external file ?

http://www.pictureperfectphotoonline.com/index2.php

View Replies !    View Related
LoadVars Question - Guru Level
Hi im trying to loads quotes from an external text file every 30 secs.
The text file contains
quote1=this is quote one&quote2=this is quote two&quote3=this is quote three

I load these variables into a LoadVars object myLV_lv

But now the question is how do i access these variables

example :

i was thinking like(p.s i know this code is not complete and i need to put some of it in the loadVars onLoad function etc... but im just highlighting the problem area)


Code:

var quoteNumber=1;
setInterval(quoteGenerator,30000);

function quoteGenerator(){
quote_txt.text=myLV_lv."quote"+quoteNumber;
quoteNumber+=1;
}
but the line
Code:
quote_txt.text=myLV_lv."quote"+quoteNumber;
does not work...i tried putting "quote"+quoteNumber in some variable e.g


Code:
abc = "quote"+quoteNumber
and then doing


Code:
quote_txt.text=myLV_lv.abc;
but it still doesnt work!!!


any help would be appreciated...

View Replies !    View Related
Loading Movie To Level 1, Cancelling Out Level 0 Buttons?
I have a movie (main.swf) and when you click one of the buttons, it loads section.swf on top of main.swf onto level 1

When section.swf appears on the screen, everything is fine BUT... the buttons on the main.swf work THROUGH the section.swf which is on level 1. Is there anyway to cancel out the buttons on level 0 when a movie is loaded ontop of it to level 1????

TIA

View Replies !    View Related
Loading A *.txt File Using LoadVars() Into A Dynamic Text Field With Html Tags?
I'm loading a *.txt file using loadVars() into a Dynamic Text Field and having no trouble with that part.

But I am wondering how I can add html tags within the *.txt file and have flash render it as it does with strings internally? Is there a way of doing this with AS? Anyone got any ideas?

View Replies !    View Related
Level 0 Loads A Movie Into Level 1 - Buttons On Level 0 Still Appear To Be Active Underneath
I am working on an interactive cd. My main movie plays in level 0 and clicking on an option loads the relevant movie into level 1.

The problem I have is that the main movie's buttons are still active underneath and if you click on the wrong place in the movie on level 1 it jumps to a new movie because of the button below.

Is there a way to somehow deactivate these while there is a movie playing above?

View Replies !    View Related
Loading To A Target Vs. Loading To A Level…?
Is loading a movie into a target the exact same as loading it into a level in regards to load time and efficiently making the movie play?

View Replies !    View Related
Loading A SWF To A Level
What is the action script I need if I wanted a background to stay static (So it never changes) but when you click on one of the buttons it loads a movie inside to a specified position on the page. But the SWF has to load ontop of the background so you can still see the buttons.

Also when I have the code can I tell it what positions like X,Y,Z.

I am doing this as I think it would be quicker than loading whole pages at a time. As this way it only has to load new content.

Cheers

View Replies !    View Related
PHP Not Loading In A Different Level
hi there,

i have a perfectly working .php file, however this file is able to update dynamic text fields in the swf movie only when it is loaded in level 0, and when i try to use the .php to update a movie loaded in level 1 for instance, it fails... even though when using the loadvariable or the loadvariablesnum to load the .php file, i specified that i want to load it in level 1...

i tried everything, i tried using both loadvariable and loadvariablenum, i tried loading the .php file in all levels, i tried even changing the name of the text field in the flash movie... but something seems to be wrong with my grasp of the problem.

Thankyou

View Replies !    View Related
Loading An Swf With Level
I'm using flash mx4 I'm trying to load a level with a button I don't know what I'm doing wrong I keep getting this error:

**Error** Symbol=screen, layer=greyboxes, frame=80:Line 1: Statement must appear within on handler
btnRed.onRelease = function() {

Total ActionScript Errors: 1 Reported Errors: 1

the instance is called btnRed.

this is the command i calling up.
btnRed.onRelease - function() {
loadMovieNum("picRedl_21",21);
}

please help

View Replies !    View Related
Loading JPG Into A Level
Hi

Guys I'm using Flash MX 2004 loading a JPG wich is working using this script

loadMovie("Images/Slides/Slide1_2.jpg","empty2");

But once I tried loading the jpg into a diferent level with this script it doesn't work.

loadMovieNum("Images/Slides/Slide1_1.jpg",1,"empty1");

I neet to use the empty1 movie to load the image because I want to have control on the x and y position of the image on the Document

thanks

Alex

View Replies !    View Related
Loading Var To A Level
Hello I have problem with loading vars to a movie clip at a specific swf file
example 1
At this example you I have load.swf being loaded into main.swf level 1 and by pressing the buttons , lang1,lang2,lang3 you may switch between loaded files (lang1.txt,lang2.txt,lang3.txt) but the problem is I cant change the var at field 2

At my buttons I have

Code:
on (release) {
//I am loading lang2.txt file to main movie
myData.load("lang2.txt");
//I am loading lang2.txt file to load.swf level 1
_level1.myData.load("lang2.txt");
//I am loading lang2.txt file to load.swf level 1 "mc" I guess the problem is here but unfortunately could not find the solution
_level1.mc.myData.load("lang2.txt");
}
For more details files are located here
main.swf
main.fla
load.swf
load.fla
lang1.txt
lang2.txt
lang3.txt

Any advices are welcome! I desperately need your help
Thanks in advance

View Replies !    View Related
Loading Var To A Level
Hello I have problem with loading vars to a movie clip at a specific swf file
example 1
At this example you I have load.swf being loaded into main.swf level 1 and by pressing the buttons , lang1,lang2,lang3 you may switch between loaded files (lang1.txt,lang2.txt,lang3.txt) but the problem is I cant change the var at field 2

At my buttons I have

Code:
on (release) {
//I am loading lang2.txt file to main movie
myData.load("lang2.txt");
//I am loading lang2.txt file to load.swf level 1
_level1.myData.load("lang2.txt");
//I am loading lang2.txt file to load.swf level 1 "mc" I guess the problem is here but unfortunately could not find the solution
_level1.mc.myData.load("lang2.txt");
}



For more details files are located here
main.swf
main.fla
load.swf
load.fla
lang1.txt
lang2.txt
lang3.txt

Any advices are welcome! I desperately need your help
Thanks in advance

View Replies !    View Related
Loading In To A Level
Okay...I've read some past threads and thought I had a solution but apparently I'm missing something.

So this is my first website using levels. I have a Main.swf and in there I load two movies, one on level 2 and one on level 3. They are loaded in using LoadMovieNum.

My problem comes in when I have a button on _level2 that when clicked is supposed to load a new movie on top of the existing movie on _level2.

I am unsure what the syntax should be.

If I load the new movie in to _level0 of the existing movie it works....but for some reason covers up what was on _level3. I am assuming this has something to do with the fact I am loading on to _level0 of a movie allready in _level2 of Main.swf Vs. just loading directly to _level2 of main.swf.

Does anyone have any suggestions? (if i haven't confused you allready)

Thanks!

View Replies !    View Related
Loading Swf In Another Level?
I was working on a purchased template and is rather newbie to flash actionscripts since I only used them for mostly animations.

Top level = main.swf
bottom level = pagexx.swf (xx = 1,2,3,etc)

Problem: When loading another swf from the main.swf into main.swf, it works fine. But now I have a problem of loading page2.swf from page1.swf which is now opened in main.swf. I've tried using loadmovienum but they overlap each other instead of page1.swf disappearing. Hope I explained the situation well enough. Here's the script from main.swf used to load page5.swf (where all the 5 = page5).

on(rollOver) {
if(_root.link<>5) {
gotoAndPlay("s1");
}
}

on(rollOut) {
if(_root.link<>5) {
gotoAndPlay("s2");
}

}

on(release) {
if(_root.link<>5 and _root.flag_animation=="true") {
_root.flag_animation="false";
_parent["item" + _root.link].gotoAndPlay("s2");
_root.main.plane.robo.gotoAndPlay("p4");
_root.link=5;
_level2.main.gotoAndPlay("dissappear");
}
}

View Replies !    View Related
Loading SWF Onto A Level
Hello,

How do you load movie.swf onto level 10 of myui.swf if they are both in the same directory? So far I have tried the following:

In myui.swf I have this code:

On (Load)
Load Movie ("movie.swf", 10)
End On

I got this from a tutorial on this site. I also tried:

On (Load)
Load Movie ("/movie.swf", 10)
End On

but that didn't work either. Any suggestions.

One more thing, I clicked onto a keyframe that I have an AS on but I don't see the code for that AS in the AS panel, what's up with that?

I'm using FLASH MX 2004 (not pro).

View Replies !    View Related
Loading Xml To Another Level?
i am trying to make a dynamic picture gallery. It has two movies...the primary at _level0 is the menu. After clicking a link, a generic dynamic gallery loads at _level1 with thumbnails that get their image from various xml files. The problem is each link will load a different xml, thus the thumbs will change accordingly. Is it possible to load an xml to _level1 from a link at _level0? Or am i going about this the wrong direction? should the xml load at _level1? or does it matter.

It seems now, i can get the xml to load at _level0 (based on a trace to the output window), but the thumbs will not load the images.

View Replies !    View Related
Loading Into Level
I need to load one external swf into level, also I need to cover something in external swf with one new simbol in holder swf. Someone have idea?

I can`t load external swf in target, so it has to be in level.

Please, can anyone help me!?

View Replies !    View Related
Loading Swf In Another Level?
I was working on a purchased template and is rather newbie to flash actionscripts since I only used them for mostly animations.

Edit: forgot to mention it's flash mx actionscript..

Top level = main.swf
bottom level = pagexx.swf (xx = 1,2,3,etc)

Problem: When loading another swf from the main.swf into main.swf, it works fine. But now I have a problem of loading page2.swf from page1.swf which is now opened in main.swf. I've tried using loadmovienum but they overlap each other instead of page1.swf disappearing. Hope I explained the situation well enough. Here's the script from main.swf used to load page5.swf (where all the 5 = page5).

on(rollOver) {
if(_root.link<>5) {
gotoAndPlay("s1");
}
}

on(rollOut) {
if(_root.link<>5) {
gotoAndPlay("s2");
}

}

on(release) {
if(_root.link<>5 and _root.flag_animation=="true") {
_root.flag_animation="false";
_parent["item" + _root.link].gotoAndPlay("s2");
_root.main.plane.robo.gotoAndPlay("p4");
_root.link=5;
_level2.main.gotoAndPlay("dissappear");
}
}

View Replies !    View Related
Loading Swf In Another Level?
I was working on a purchased template and is rather newbie to flash actionscripts since I only used them for mostly animations.

Edit: forgot to mention it's flash mx actionscript..

Top level = main.swf
bottom level = pagexx.swf (xx = 1,2,3,etc)

Problem: When loading another swf from the main.swf into main.swf, it works fine. But now I have a problem of loading page2.swf from page1.swf which is now opened in main.swf. I've tried using loadmovienum but they overlap each other instead of page1.swf disappearing. Hope I explained the situation well enough. Here's the script from main.swf used to load page5.swf (where all the 5 = page5).

on(rollOver) {
if(_root.link<>5) {
gotoAndPlay("s1");
}
}

on(rollOut) {
if(_root.link<>5) {
gotoAndPlay("s2");
}

}

on(release) {
if(_root.link<>5 and _root.flag_animation=="true") {
_root.flag_animation="false";
_parent["item" + _root.link].gotoAndPlay("s2");
_root.main.plane.robo.gotoAndPlay("p4");
_root.link=5;
_level2.main.gotoAndPlay("dissappear");
}
}

View Replies !    View Related
Loading On Level O
hi i posted a question on loading and unloading but this guy told me if im loading my movie on level 0 does any one know how to load on level 0 because my problem is that when my site loads i want the welcome info to pop up then when i click on the next buttons the other info will load on top of that can some one help me or point me to a tutorial thanks.
to check out my site to see what im talking about

infinit studios

View Replies !    View Related
Loading From Another Level?
hey...

Is it possible to to preload my newmovie.swf into level 2, from my current swf on level 2?

The problem i have, is that i want to load something onto level 2, but if i could preload it from the existing swf on level2 then the content could remain until the new stuff is loaded.

understand? is that possible?

thanks




cuse

View Replies !    View Related
New LoadVars Remote Loading Just Not LOaDInG
Ok heres the deal. this script works great locally but remotely it chokes.... I havent been able to figure out what the issue is yet but would greatly appreciate the pointers.

Ok I have a movie clip that does all the work with the instance name of "SmartText" inside this I have five frames "Start,Loading,return,checkit and Loading" all in that order.

in Start(the first frame) I have the following frame functions:
container = new LoadVars();
//need only change the names and maybe levels


container.load(_global.textname);
function percentages() {
percentloaded = Math.round((quant/total)*100);
if (_global.vat ==4){
_level2.txtinfo.MyText.wintext.window_text.htmlTex t= "<i>loading"+percentloaded+"%</i>";
}
else {
_level2.txtinfo.MyText.window_text.htmlText = "<i>loading"+percentloaded+"%</i>";
}

}

function finload() {
//which means if on services page
if (_global.vat == 4) {
_level2.txtinfo.MyText.wintext.window_text.htmlTex t =container.window_text;
_level2.title.htmlText =container.title;
}else if (_global.vat == 2){
//which means if on home page
_level2.txtinfo.window_text.htmlText = container.window_text;
_level2.txtinfo.title.htmlText = container.title;
}

//if on aboutus
else if (_global.vat == 1){
_level2.txtinfo.window_text.htmlText = container.window_text;
}

//if on contact
else if (_global.vat == 7){
_level2.txtinfo.window_text.htmlText = container.window_text;


}}

basically I have started the new LoadVars and created two functions
percentages(), which should generate percentage loaded and finload()which should load the info in the correct location.

Loading (second frame) I have the following AS:

quant = Math.round(container.getBytesLoaded());
total = Math.round(container.getBytesTotal());
percentages();
if (quant>=total) {
gotoAndPlay("checkit");
}

return (third Frame) I have:
gotoAndPlay("loading");

checkit (fourth Frame) I got:

quant = Math.round(container.getBytesLoaded());
total = Math.round(container.getBytesTotal());
percentages();
if (quant>=total) {
gotoAndPlay("loaded");
} else {
gotoAndPlay("loading");
}


Loaded I simply have:
finload();
stop();






thanx again to all who attempt to unravel my mistery.
cheers

View Replies !    View Related
LoadVars Not Loading On WEB HELP
I just put my site up on a server and I discovered that LoadVars wasn't reading in data. This is done in the first 6 frames of the movie. The site is ecommerce sorta thing so I am reading in the data for the products from text files (one file for each item)
Please, please check this out. (yes I have resorted to begging now)

Here is the loading function, the call to load the items,and using the variables

Frame 1:

Code:
function loadProdVars(product) {
var loadedFlag = false;
prodVars = new LoadVars();
prodVars.load(product); <********
loadedFlag = prodVars.onLoad=function () {
loadedFlag = true;
return loadedFlag;
};
for (i=0; !loadedFlag; i++) {
trace("Not yet loaded");
}

return prodVars;
}

// Also the object that needs to use the text is defined on Frame one
// _global.Product = function (name,id...........
// and the associated Product.prototype functions

//Frame 2:

item1Vars = new LoadVars();
item1Vars = loadProdVars("item1Data.txt");

//Frame 3:

item1Object = new Product(item1Vars.title, item1Vars.prodID........
Frame 6:
The site contents load

In Movie:
Call on a button press to view the product
item1Object.showProduct(blank_mc_to_load_the_swf)

It does not display the product on the web because I think that the product object was not created (properly) and doesn't know the link to the item's swf location (its read in from the text files)

I have also tried changing the line denoted with the ****'s to include the full url of the text file location such as
xxxVars.load("http://www.mydomain.com/"+product);
No avail.

Works fine on my PC and also locally with IE on http://localhost using the version posted (not the load(....mydomain.com/...) version obviously)

ANY help would be great!

John

View Replies !    View Related
LoadVars Not Loading :(
http://www.perseeve.com/test2/textTest.html

http://www.perseeve.com/test2/textTest.fla

The problem:

This is a stripped-down version of my external file loader which I'm having problems with. I'm testing two different LoadVars styles of loading, onLoad() and onData(). I'm applying the onLoad() to the left paragraph, onData() to the right paragraph. Here's the code:

Frame 1:

PHP Code:



//'fileDir+_global.textNane[i].name <-- reference to external .txt file
 //i.e., '/txt/about0.txt'.

function popTxtLoad(i) {
    var fileDir = "txt/";
    var fileExt = ".txt";
    
    myData_popTxt = new LoadVars();
    myData_popTxt.load(fileDir+_global.textName[i].name);
    myData_popTxt.onLoad = function(success) {
        if(success) {
            rawString = unescape(this);
            _global.cleanTxtLoad[i] = rawString.substr(0, rawString.indexOf("=&onLoad=[type Function]"));
        }
    };
};

function popTxtData(i) {
    var fileDir = "txt/";
    var fileExt = ".txt";
    
    myData_popTxt = new LoadVars();
    myData_popTxt.load(fileDir+_global.textName[i].name);
    myData_popTxt.onData = function(raw) {
        if(raw != "" && myData_popTxt.getBytesLoaded() == myData_popTxt.getBytesTotal()) {
            _global.cleanTxtData[0] = raw;
        }
    };
}; 




I then apply those functions like so:

Frame 2:

PHP Code:



popTxtLoad(0);
popTxtData(0); 




Frame 3:

PHP Code:



stop();

//proxy variables so I can define all externally loaded variables
 //in the first frame of my movie(s).
sec0Text = _global.cleanTxtLoad[0];
sec1Text = _global.cleanTxtData[0];

myText1.text = sec0Text;
myText2.text = sec1Text; 




When I test the FLA from the 'Test Movie' function in Flash, it works fine. When I test it locally (localhost) and uploaded to my server, that's when there's problems.

When You visit the .html file above, depending on the browser you use (IE 5.2 for Mac, Safari 1.0.2 for Mac, and Netscape 7.01 for Mac are what I tested with) the two paragraphs that *should* be displaying, don't.

In Safari it's successful with the left paragraph 95% of the time, the right paragraph only with refresh (which is bad, it should show up right away).

In Netscape the results are similar to Safari.

In IE is where I'm super-stumped up the wazoo. Neither paragraph shows up, even with multiple refreshes.

I've tried embedding my font, not embedding my font, not compressing the FLA, compressing the FLA, nothing works. The font is just Arial, set to color 0x000000, 11-pt.

So now I come to you, my esteemed ActionScript associates, humbled and confused. Help?

View Replies !    View Related
Not Loading LoadVars
tell me what im doing wrong please.....

ActionScript Code:
var loadConf:LoadVars = new LoadVars();
load('widgets.conf', loadConf);
loadConf.onLoad = function() {
wd = loadConf.Widgetsdir;
bd = loadConf.Backgrounddir;
active = loadConf.ActiveWidgets;
trace(wd+","+bd+","+active);
};
stop();




1 frame with that code in it.
saved to same folder were 'widgets.conf' resides.
and the output box (were traces goes) stays empty, not even an error message

Ideas?

//VoS

View Replies !    View Related
LoadVars Not Loading
I am working on a project which is supposed to load external data via php using loadVars. My code is as follows:


ActionScript Code:
lista.onLoad=function(success){
    if (success){
        _root.loadbkg.visible=false;
        _root.finestra._alpha=100;
        function carica(){
            if(i==lista.vanth){
                i = 0;
            }
            url="http://www.gaetanocastelli.com/setdesign.php?id=";
            _root.finestra.dati.htmlText = '<a href='+ url + lista["id"+i] + '>' + lista["titolo"+i] + ' ' + lista["anno"+i] + '</a><br />';
 
        }
    }
    carica();
}


I am sure, through several tests, that the program reaches the line


ActionScript Code:
function carica(){


But then is seems it just does not execute the function. Where am I going wrong?

View Replies !    View Related
Loading An .swf Into Level 1... Won't Play?
I am loading an .swf file (select.swf) into my main movie using
loadMovieNum ("select.swf", 1);
and it loads into my movie. BUT.... I can't get the loaded clip to play.

The select.swf file is supposed to load an external text file into a selectable list (which was interesting to figure out itself!). The select.swf file works as its own .fla, that is, opening select.fla will open the correct text file and display it, etc. But as soon as I load it into my main movie, it just sits there. I can click on the buttons, but it doesn't do anything (i.e. load the correct text file).

Any helpful suggestions? If you would like to look at my source, please ask.
Thank you!

-Tamar

View Replies !    View Related
Loading Movie/level HELP
I have a movie (with its own internal variables) that I want to load into another movie with the navigation. Problem is I want it BENEATH the navigation (level0). I tried makin yet another movie that brought in both the navigation (on level 5) and the new movie (level 1). For some reason the new movie didn't work when it was loaded beneath the navigation.
Just so you know what is in the swf i am trying to load: it simply tracks the _ymouse and tells a clip within it to go to a specific frame.

Please help!

Thanks.

ROBT

View Replies !    View Related
Changing Level After Loading
Hi,

does anybody know, how to change a loaded swf´s level?
I have a loader-swf on level0 that loads the main movie on level1. After finished loading at level1 I want that main-swf to change/replace to level0.

Does anybody know how to realize this?

It´s urgent... thanks!

Manuel

View Replies !    View Related
Loading With Target Instead Of Level?
Ok so then "MyMovie" is the swf file??
But then I do want to load it into another movie clip, so the problem was wether the name of the movie clip I loaded my movie clip into changes into the name of the flash e.g. swf file?
thanks for answers, c

View Replies !    View Related
Loading MC Into Level OnLoad? Help Please
Hi,

I have a flash movie that I need to load into a level as soon as the original movie has loaded.

I'm currently using this code with no success

onload = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("title.swf", "container");
container._x = 130 ;
container._y = 20 ;
}

I can't figure out what's wrong, could any one help please


Cheers

hitby

View Replies !    View Related
Random Level Loading
I have this small piece of actionscript that i've been given to load a random level:

loadMovieNum(["intro"+(random(6)+1)+".swf"], +(random(6)+1)+"1");

this loads 1 of 6 possible layers and, works fine but when it comes to unloading the layer I'm not sure which layer to unload. It looks as If it loads to level 1 but I've tried unloading levels 1 to 6 but no joy!

any ideas?

thanks,

jb

View Replies !    View Related
Level Loading Mismatch.
Flash Gurus,

I have a problem with loading levels (sure it’s fairly simple. I have included the file as an example)

I have five flash files. The main one that calls the other levels is called “master” the other are Vid 1 – 4. Now what happens is when you open up master.swf you are presented with four buttons (in the backgound is a few colored squares that represent a nested symbol. I wanted to mess with the _level”num”.) All of the vid.swfs have the same thing on the time line except for there “instance name”. Now the buttons on master.swf have the following code

Button 1
---------------------
on (release) {
loadMovieNum("vid.swf", 1);
_level2.gotoAndPlay("TEST2");
_level3.gotoAndPlay("TEST3");
_level4.gotoAndPlay("TEST4");
}

Button 2
-----------------------
on (release) {
loadMovieNum("vid2.swf", 2);
_level1.gotoAndPlay("TEST");
_level3.gotoAndPlay("TEST3");
_level4.gotoAndPlay("TEST4");
}

Button 3
-----------------------
on (release) {
loadMovieNum("vid3.swf", 3);
_level1.gotoAndPlay("TEST");
_level2.gotoAndPlay("TEST2");
_level4.gotoAndPlay("TEST4");
}

Button 4
-------------------------
on (release) {
loadMovieNum("vid4.swf", 4);
_level1.gotoAndPlay("TEST");
_level2.gotoAndPlay("TEST2");
_level3.gotoAndPlay("TEST3");
}


This logic does work the problem with it is when you click on button 1 and then on button 4 levels that shouldn’t load, load. The functionality I was looking for was when you click on button 1 a slider comes down when you click on button 4 the slider from button 1 goes up and the slider from button 4 comes down. The funny thing is the slider from button 3 shows up with the slider from button 4. Yes this is very; very confusing this is the reason why I included the fla’s. Once you see what I'm talking about I'm sure its simple.

Thanks in advanced.

View Replies !    View Related
Loading A Movie Into A Level
Hi,
I can't understand the "level" thing in "loadMovieNum". What is the level...?please help me.
Thanks,

View Replies !    View Related
Prevent Loading Swf Into Level 1 When..
Hi all,

I'm trying to make a sound on/off button in my main swf.Only coding seems to be a struggle.?I have 4 buttos on my main swf with code like this.
// button for song 1
on(release){
_level1.unloadMovie(); // empty old song from level 1
loadMovieNum("urltosong1.swf",1); // load new song in level 1
}

Like you see on release of but1,2,3or4 they load a swf into level1.The sound on/off button should prevent loading sound into level1 when hitting but1,2,3 or 4 .How do this?

Big thx in advance.

Grtz

View Replies !    View Related
Sound Swf Loading In Level
I have 4 sound samples with this on the 1st frame

first = new Sound();
second = new Sound();
third = new Sound();
fourth = new Sound();
first.attachSound("first");
second.attachSound("second");
third.attachSound("third");
fourth.attachSound("fourth");

this is on the buttons -
on (press, release) {
_level2.gotoAndPlay("first");
}

on the frame there is -
first.start(0,1)
second.stop("second")
third.stop("third")
fourth.stop("fourth") and so on.
It works fine until I load this swf into my main movie into a level. (level 2 btw)

what am I doing wrong?

View Replies !    View Related
Loading An External Swf Into Level 2
This used to be easy in previous versions, but now its a headache. All I want to do is load a movieclip (with sound) into level 2 of my movie. the code flash mx generates is this:


on (release) {

//load Movie Behavior
if(2 == Number(2)){
loadMovieNum("sound1.swf",2);
} else {
2.loadMovie("sound1.swf");
}
//End Behavior

}

but it doesn't work, why not, anyone?

View Replies !    View Related
Loading Multiple .swf On One Level?
Hi!

I need to load several .swf in one main movie. I have managed to make them all load from a loadmovie action on frame one of the main movie by assigning them different levels (level 1 to level 6). But I need them to work independently from one another. Now it seems the lower levels can have an influence on higher levels, but not vice versa. In other words, if I activate the swf on level 1, I can still activate the other ones, but if I activate the .swf on level 6 first, I can no longer activate the .swf on lower levels.

I there a way I can place them all on a same level? (Right now only one of them shows if I do that).

Thank you very much. I hope my question makes sense. Any help is greatly apreciated!

View Replies !    View Related
Loading Sound In A New Level
hi guys

i downloaded a sound loop in an swf format frm Flashkit, and its got STOP at the firt frame (i think). would like to know how do i make it play after loading it to level ?
for now,i've got at first frame of my SWF:

loadMovie("sound.swf",2);



thanx
Erez

View Replies !    View Related
Loading Sound In A New Level
hi guys

i downloaded a sound loop in an swf format frm Flashkit, and its got STOP at the firt frame (i think). would like to know how do i make it play after loading it to level ?
for now,i've got at first frame of my SWF:

loadMovie("sound.swf",2);
_level2.play();




thanx
Erez

View Replies !    View Related
Loading An Mc From The Library Onto A Level?
Hi all...

Again, another basic one I think, but what I have been doing doesn't seem to be working, so would appreciate any help.

On the press of a button, I would like a movie clip to load onto a certain level from the library, is this possible?

Any help would be greatly appreciated...

Thanks.

Cam.

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