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




LoadVariables Button Ques



Hello all. I have this code attached to a button calling up a different text file to a dynamic text field and it works fine, except I'm having to hit the button "twice" for it to work. Can't figure out why. Can someone enlighten me please?


code:

on (release) {
scrolltext = scrolltext1;
loadVariables ("scrolltext1.txt", scrolltext1);
}

Thanks in advance



FlashKit > Flash Help > Flash ActionScript
Posted on: 03-01-2002, 12:07 PM


View Complete Forum Thread with Replies

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

Button Ques
Ok real dumb ques..I have this animation..u can dl it from here: www.zeroxposur.com/test/nav.fla
So what I want to do is have 5 buttons fade in ..onto the bar as it finishes its animation..but I dont know how to do it.. Can anyone point me in the right direction. Thanks

Nav Ques
Hey guys I seem to remember a thread regarding how to make this kinda of NAV :

http://dopepope.com/ntps/Build_onff/


Anyone remember the thread or have a link on a tutorial to dup that kind of load jpg and have the window resize automatically...thanks all

LoadVariables(Num?) Into A Button
i have a nav menu that expands and contracts on(release); - i want the button names editable via a text file (using dynamic fields in the buttons themselves - can i do that?) but as soon as i put "loadVariablesNum ("menu.txt", 0);" in a frame on the main stage the actions stop working - if i do "loadVariables ("menu.txt", 0):" then the actions work but the fieds don't read the text file - it shows me _level0, or something; what am i missing here, someone please?

thanks
glenn

_parent. Ques
im trying to load an external jpg. and the file name of this jpg is the name of the mc 2 levels above the command.
if u dont understand this is thi code im trying to use

Code:
x = _parent._parent._name;
loadMovieNum("x".jpg, 1);

i also tried putting th eparent crap in the load move itself like this

Code:
loadMovieNum("_parent._parent._name".jpg, 1);

and its still not working. any one able to give some advice

AttachMovie Ques
Hi -
I'm using the code below to bring mcs from the Library to the stage. It works fine until I tried to add the x,y at the end.
I thought there was a way to include _x and _y coordinates to the same statement as the attactMovie. Is there?

TIA the correct way to accomplish this.

jl







Attach Code

mc_btn2.btn2.onRelease = function():Void {

attachMovie("Q2WithGame","Q2Game",this.getNextHighestDepth,[_x=45,_y=110]);

};

Simple AS 1.0 Ques
AS 1.0
I have this code in a keyframe on the main timeline:

var score = 0;
if (score == 2500){trace("winner")}

Othe stage in the maintimeline i have a dynamic text field I labeled "score" in the var box. The instance name is "pts" but i wasnt sure if i needed an instance name anyway here. The score box works fine as far as keeping score but when it reaches 2500, I dont get my trace. What am I missing? Thanks

-Chris

Stupid Ques
hello new be ere (welsh) i got a prob wanderin if some1 could help im tryin to get a news page that updates ive got this off yahoo

this

so now tryin to use it but flash does ntlike it im prob doin some thing stupidly wrong now on the verge of not botherin

PLEASE HELP

Attaching MC Ques
hi.. anyone out there can give me a tutorial which teaches attaching a MC to another MC?? urgent..

Stupid Ques
hello new be ere (welsh) i got a prob wanderin if some1 could help im tryin to get a news page that updates ive got this off yahoo

this

so now tryin to use it but flash does ntlike it im prob doin some thing stupidly wrong now on the verge of not botherin

PLEASE HELP

Flash Ques
please can you explane me how can I make this file like on this site:
http://www.t-s-k-b.com .You go on this site and press SAKUBA WORKS and then button Painting/Drawing

I would like to make a picture gallery like in Painting/Drawing: So how I can make when the mause on the button to show small image of the picture and when I press the image to open the picture how is on the site(not in a new window)?
Please tell give me advice how could I make it!
thank you

Another Loading Ques
Is it possible to make the movie load let's say... only the 1st 2 frames of movie that has 8?

Easy AS Ques.
ok so I have a flash doc..theres a an MC called target on mainstage that has the entite site in it (doing a fullscreen centered website)..now I have MC nav buttons on the stage (inside target). Inside one of the nav buttons I have a line of AS that says


ActionScript Code:
this.onRelease = function(){
    _root.target.loadMovie("bioresume.swf", "loader");
}


Now im not sure If im doing that right..but what i want to happen is; after u release the button, load the ext swf into the empty MC called "loader". But what seems to be happening is it loads the ext swf but everything else on the site disappears. See I originally had this as my AS cause i thought this made sense but it ends up not doing anything:


ActionScript Code:
this.onRelease = function(){
    loadMovie("bioresume.swf", "loader");
}


So if anyone knows what I did wrong, much appreciation. Heres the site link if u want a visual:

www.josephsernio.com/test

Easy As Ques.
Ok for some reason the end of this code doesnt work.. on release, i want it to take me to frame 2..and it wont...btw this a movie clip that has button properties through AS:



stop();

this.onEnterFrame = function(){

if(rewind == true){

prevFrame();

}

}

this.onRollOver = function(){

rewind = false;
play();

}

this.onRollOut = function(){

rewind = true;

}

this.onRelease = function(){
gotoAndStop(2);

}

MC Loader As Ques.
im working with the moviecliploader AS..so a button loads an ext SWF and also has a percentage loader .. so on my mainstage i have a loader mc (instance name "loader")and a holder mc (instance name "holder")..heres my AS on the main timeline:

var mcl:MovieClipLoader = new MovieClipLoader();

var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total) {
loader.percent.text = Math.round((loaded/total) * 100) + "%";
}

mclL.onLoadInit = function() {
loader._visible = false;
loader.percent.text = "";
}

mcl.addListener(mclL);





Now i have another MC that houses about 20 or so buttons..so within the buttons MC i have say this for one of the buttons:

b4sub.onRelease = function() {
_root.loader._visible = true;
_root.mcl.loadClip("LevisCampaign.swf",holder);



And unfortunetly it doesnt to load the ext. swf..did I code the _root incorrectly?

Thanks for your help.

Fscommand Ques
Hi all, I was working with fscommand, when it struck me what FSCOMMAND stands for.

"Future Splash Command"

Can anybody confirm this, or am I mad, lol

Later

ORANGE900

Loadvariables For A Rollover Button
how to loadvariables to a movieclip and call that movieclip on Rollover.

I have button which has text loaded by loadVariables. Now on rollover i want to rotate the loaded variable. therefore i have placed a movieclip on button rollover.

Now how can i make loadVariables function on that movieclip.

Easy - Pong AI Ques.
Ok just to see if I could do it(never really got into game programming) I tried to make a pong game everything works so far but I have a problem with this:
Flash code:

PHP Code:



onClipEvent(enterFrame) {
if(_global.cspeed == 0) {
}else{
    if (this._y != _root.ball._y){
        if(_root.ball._y < this._y){
                this._y -= _global.cspeed;
        }else if(_root.ball._y > this._y){
                this._y += _global.cspeed;
        }else{
                this._y = this._y;
        }
    }
}
}




The problem is that instead of moving smoothly up the screen it looks like it s shaking up and down really quickly, but I would like it to be smooth.
Please help.

Movie Clip Ques
Hey i just started doing flash yesterday and i am doing a text fade

I made the motion tween and and everything and when i go to control and play everything is smooth but when i go to test movie nothing it just stays the same and doesnt fade :> plz help me

Movie Clip Ques
Hey i just started doing flash yesterday and i am doing a text fade

I made the motion tween and and everything and when i go to control and play everything is smooth but when i go to test movie nothing it just stays the same and doesnt fade :> plz help me

Quick Mask Ques
Im sure this is an easy one.. on the foofighters website http://www.foofighters.com When U click a button that flourish/swashy graphic looks like it is unwinding or growing rather. I would like to get the same effect.. Its obviously a mask of some sort. I know who to mask, im just figuring its a mask that is animated somehow. Anyone have an idea? Appreciate any insight into this. Peace

-R

Quick Actionscript Ques.
Ok so im building a portfolio website and basically if you click on the art image it goes tothe next art image..I have it set up so the art images are buttons and when u click it, it is coded to goto next scene..On one scene however the art image is a movieclip (fading effect)...now how do you write the actionscript so if you click on the movieclip it goes to the next scene? I dk im right but...my guess is to put the MC within a button symbol? But I dk. Thanks guys.

UI Text Input Ques.
Ok so Im making a form in flashmx2004..I drag out onto the stage the UI compnent textinput box..now I want to make this box multiline but it doesnt give me the option to do so. Do I have to make input boxes in a different way?

Motion Guide Ques
Hi all,
Is it possible to create a motion guide, so the object connected to the motion guide is always in the centre of the screen.

What I mean is, if we were trying to go from point A to point B
we could see the full journey of the object travelling along motion guide in the centre of the screen.

A-------->--------->-------->------B

The sort of thing I mean is included, but with no motion guide instead, the car remains in the centre of screen and is able to move around the track which in turns moves the the track below.

Thanks for your time, sorry for the broken language. Hope you can help.

--------------
FLA = MM2004

<> QUICK QUES RE:Positioning After Dupe
Hi Im using a while loop and the dupliacteMovieClip() to dupe a certain number of my Mc's. I want to postion each duped Mc after its created with setProperty but I cant figure out how to do this within the same loop.
It complains in output box:

Symbol=playlist_Mc, Layer=Layer 2, Frame=1: Line 9: Expected a field name after '.' operator.setProperty(_root.playlist."box" + count, _y, vertpos);

Obviously I cant do the <"box" + count> bit, but how else can i do it?
(see code below)



Code:
onClipEvent(load){

var vertpos = 46;
var count = 0;
//create
while(count!=4)
{
duplicateMovieClip(_root.playlist.box, "box" + count, 1);
-->this doesnt work//setProperty(_root.playlist."box" + count, _y, vertpos);

trace(count);
count++;
}
//position
}


-Rich

Pleez Help With Random Keyframe Ques.
I have four different movie clips on four different keyframes (2-5) the first key frame has a clip with an invisible button over it. WHat I would like to achieve is onMouseover of the button in the first frame......I would like the playhead to randomly gotoAndStop on of the other frames (2-5). To give the illusion of random movement. The on mouseout return to the first keyframe. any help greatly appreciated....either a .fla I can study or some AS would be great.

Probably Simple LoadMovie Ques. For JPEGs
I have a target MC that I want to load some JPG's into in my Flash Movie. The Target MC's dimensions are 650x500px. The JPG's are the same. When I attempt to load them, I can notice that something has changed in the tone of the movie clip (I had the target MC a grey color then that color disappears) but the JPG does not load.

I tried a smaller JPG, like 1/4 the size, and it loaded OK. ANyone have a suggestion?

Action Script Ref Code Ques
Hello i keep getting this this action script error when i attempt to render this swf could some one explain what this error message means ......i am not sure what the variables are looking for ....... the version is Flash 8 - the action script is below and the error message is below that.......

#include "lmc_tween.as"
//classes are loaded on this frame
var state:com.collection.State = new com.collection.State(this);
// start program
var main:com.collection.Main = new com.collection.Main(this)
//
bg_img.tween("_alpha",100,1,"linear",.5)
stop()

Error message (below)

**Error** Scene=Scene 1, layer=actions, frame=5:Line 1: Error opening include file lmc_tween.as: File not found.
#include "lmc_tween.as"

**Error** Scene=Scene 1, layer=actions, frame=5:Line 3: The class or interface 'com.collection.State' could not be loaded.
var state:com.collection.State = new com.collection.State(this);

**Error** Scene=Scene 1, layer=actions, frame=5:Line 5: The class or interface 'com.collection.Main' could not be loaded.
var main:com.collection.Main = new com.collection.Main(this)

Total ActionScript Errors: 3 Reported Errors: 3

Action Script Ref Code Ques 2.0
Hello please see this link it is a follow up to the thread i created before....i am stil trying to figure this error out when i generate the flash swf it works but not properly... below is a link to what the swf looks like there are buttons that should show and i get this message (shown below) in the flash error box that says (output) when i hit ctrl+enter to generate the swf.... any suggestions...?

b1,b2,lgText,redText,arrow,a:link,a:hover
yo

http://www.amjaydesign.com/mainCol.html


http://board.flashkit.com/board/showthread.php?t=744878

Simple Ques About Blue Border Box
I'm using flash 8. When you draw something or import a picture flash 8 puts the blue border box around it. Well mine is gone. If I draw something and click on it it is a broken shape. How do I get the blue border box back?thanks

LoadVariables Vs Using A Button To Send Form Info
i have one layer with all my input text boxes and my button.
then on the action script i have:


Code:


on (release)
{
getURL("flash.php", "_blank", "POST");
}



this is sending all the info thats entered into the text fields to a php script i wrote, but i dont have any combo or radios..etc.. so i dont even know if it would work for those.

my question is and i dont know how to word it ive read two popular tutorials on forms but they not NOT specific when it comes to this:

is there one action script page to each scene? meaning i dont have a seperate action page for each button, label..etc on my scene instead i have one main action script page where i put all my functions and call them through each component?
if someone could help clear it up for me i can understand setting up the loadvariable form and understand it

Loading Clips Into Levels? -quick Ques
Hi, I need a quick bit of code or at least somebody to give me an idea on how to actually have a clip load itelf into a specific level depending on the value of a variable. I want to do this as my duplicateMovieClip() code is putting MC's on higher levels than other elements (other Mc's) in my movie, and one of these elements in perticular needs to be the 'highest'.

I tried using setProperty() as below but it doesnt work, flash complains (I gather it doesnt consider '_level' as a property?)

Code:

setProperty(need2BHighest_Mc, _level, highestLevel);




Any help appreciated

Html Code Inside Flash Ques
I have a client who wants me too put some html inside the flash actionscript. He's not sure it will work and I'm not sure if it's possible or how to do it. Here's the code any suggestions thanks

<form action="/gift/save/1234" enctype="multipart/form-data"
method="post">
<input name="file" type="file" />
</form>

LoadVariables: Can Two LoadVariables In The Same Script Cause A Problem?
Hi,

It seems that for some reason, my attempt to send vaiables is not working. I'm not certain if its my syntax or the fact that I have a second loadVariables later in my script(with a different name of course). help?

heres a sample of the script that I'm using:

ClickedSendVar = new loadVariables();
ClickedSend = "bob="+bob+"&fred="+fred+"&jim"+jim;
ClickedSend.send(_root.on_card, ClickedSend, "POST");

LoadVariables From CGI
Why does it work from my HD, and not on the Web.

When I run the SWF in flash it load the vars ok. Then I tested outside Flash, in the Flash PLayer, and in the Browser both from the HD. The file was on my HD but the script still gets the vars from a valid URL.

I load the vars like this:
loadVariablesNum ("http://www.mydomain.com/cgi-bin/flashclock.pl", 1);

In the dubugger window, all the vars are loaded correctly only when the file run from the HD.
Then I run the (SWF) file from the web, and the debugger window only show me the _level0 objects and vars. NOTHING from _level1 (to witch i'm loading them).

I tested the PL right in the browser to, and it outputs everything correct, like:
&name=paul&weight=85&...

Is loadVariablesNum a wrong method to get the vars from a pl file.

H E L P !!!!

LoadVariables + Php
I have this tiny PHP script that I would like to call in order to generate a string to be used as a variable:

Code:
<?php
// filename is 'metar.php' located on server 'your_url_here'
echo "metar=";
$fp = fopen ("http://weather.noaa.gov/pub/data/obs...tions/CYUL.TXT", "r");

// The above URL retrieves the latest weather data for Montreal's Intl. Airport.
// Hack the source at http://www.gimpster.com/php/phpweather/index.php PHP Weather for how to interpret the value.

while (!feof ($fp)){
$metar = fgets($fp, 4096);
echo $metar;
}
fclose ($fp);
?>
In my flash movie, I call that script on fr.1 using

Code:
loadVariables("http://your_url_here/metar.php", "");
and I have a dynamic text field which is linked to the variable metar.

Of course it doesn't work so far. Any pointer why and/or how to make it work?

thanks and cheers

D.

LoadVariables Bug?
Im getting feed back from my users that when they try to login it hangs.

all im doing is a simple task they type userid and pass click next

loadvariables from a CGI script which checks the userid and pass sends back a responce of either wrong or ok

while flash is waiting for this responce i do this.

if (responce eq "ok"){
gotoandplay("ok")
}
elseif(responce eq "wrong"){
gotoandplay("wrong")
}
else{
prevframe
}

#################
the previous frame is just a play() to check the status again.

so why is it hanging? is there any know problems with this method like using it in different browsers or platforms??

or if anyone has a better method i will be happy to listen.

Danny

LoadVariables
Hello,

I have 10 frames in my movie and each frame has 2 loadvariableNum command to load text into 2 different dynamic text boxes in my main movie. 1 loadvariableNum command looks for data from the database and the other from a text file. When I try it out, only 1 LoadVarNum command works, meaning that text var 1 will populate with text but not text var 2. I have both variables loading into level_0. What is the processing order for LoadVarNum command? Is there a certain order that they load in?

Loadvariables Help
I have a simple menu on a page called menu.html with four selections (red, yellow, green and orange). This opens a pop up window (menupop.asp) with the following code:

<%color = request.form("color")%>
<script>
var color = "<%=color%>"
</script>

This page has a flash movie with the code:

stop ();
loadVariables ("menupop.asp", "0", "POST");
gotoAndStop (color);

There are four frames with labels red, yellow, green and orange, but is not going to the right frame.

Any solutions?

I'll try to upload the pages later (my server's being a pain).

-Brandon
[Edited by bugkarma on 10-16-2001 at 02:00 PM]

Help With Loadvariables
I have a simple menu on a page called menu.html with four selections (red, yellow, green and orange). This opens a pop up window (menupop.asp) with the following code:

<%color = request.form("color")%>
<script>
var color = "<%=color%>"
</script>

This page has a flash movie with the code:

stop ();
loadVariables ("menupop.asp", "0", "POST");
gotoAndStop (color);

There are four frames with labels red, yellow, green and orange, but is not going to the right frame.

Any solutions?

You can see the pages at http://www.neweconomydesign.com/test/menu.html

-Brandon

HELP With LoadVariables
I ma trying to load variable values from a text file. Nothing seems to work to make this happen. I have a file in the same folder as the .fla file. It is called "data.txt" and it contains the following-s1Var=4

In the first frame of the movie I have the following code
loadVariables("data.txt",0)
trace(s1Var);

this always returns 0. How do I make this work???

LoadVariables
Please someone help!
Does anyone know where i can get some information or an example of how to use the loadvariables command.
I am very confused on how to use it.
I have a templete that i need to have variables from a data file to load into.
On the first frame of my swf. i have
loadVariables(url.questions)

the url is typed out correctly, this is the data page with various variables with values.

the questions is the name of the text variable in the flash movie where i want the value of the variable from the data file to be placed.

I have many questions, how does the loadvariables know exactly what variable i need and where to place it.

i hope this makes sense. please, if anyone knows what i am trying to describe or knows of a tutorial i can use, please tell me. the stress and pressure from my bosses is horrible.

if you have not figured it out, i am just learning actionscripting.

thanks,
dawn

LoadVariables
How does the loadVariables command work?

I want to create a button that, on release, reads variables from a text file. Then the variables must be put in textboxes.

I have a .swf file and the text file in a folder on my hd.

What has to be in the text file and how does the loadVariables command work?

Say I want to read test="hello" and then have in a text box in the movie "hello" in a text box

Loadvariables
Hello, I am creating windows in flash and I am trying to import data from a text file using loadvariables. i.e.

("aboutUs.txt", "_root.aboutUsWindow.window.text_box");

the text file looks like this:

textField=<blah blah blah>

(textfield is within text_box).
This works fine except that now, I want to load multiple variables into different text fields from the same file.

Please help.

prac2

LoadVariables
Hi,
I have an flash movie and I have a movie clip in that. I change the color of the clip according to the database value which I get using ASP. In the frame actions actionscript, I change the color of movieclip according to the return value from ASP, still the color does not change. I checked the variable value and it is not set too. I gave red color before calling LoadVariables (which passes green), the color is not changed. What can be the reason. I have written the code in any event, just in the frame actions main script place.

Any help is appreciated.

Thanks
-r-

LoadVariables
Hi, I need help with loadVariables. I have a movie clip named "blah" containing a dynamic textbox with the variable set to "text," and I have the line:

loadVariables("blah.txt",_root.blah.text);

loaded into my actions layer. Yes, blah.txt is in the same directory as the flash. I want to load blah.txt into the textbox. What am I doing wrong here? Thanks

LoadVariables()
Hi there,

Would like to ask regarding the movieClip.loadVariables() action. The second parameter is supposed to be "GET" or "POST" right? Is this "GET" or "POST" action the passing of variables into flash, or is flash passing variables into another application?

For that matter, I am aware that by specifying the additional parameters with the URL string, you can simulate a GET request to a server. I'd like to ask then, how can I use Flash to do a POST action?

Thanks.

Regards,
KA

LoadVariables (again)
I want to load a list of (text) variables from a .txt file into a mc, using a split (into an array). There should also be a (invisible) button attached to each variable, in order to enter a url link and the number of variables is not fixed. I tried everything, I have the overall idea, but it still won't work... Can someone explain me step by step what to do ?

Loadvariables
I want my buttoninstances to have a variable name.
I made an MC,
on frame 1 : loadVariables("/fotos/fotos.txt",_root);
on fame 15: event1.eventname.Text= _root.event1;
event2.eventname.Text= _root.event2;
...

in the txt file :&event1=button1
&event2=button2
...

but I don't see the button names when I upload the site, or even when I preview the html file.
this I probably a dumb question, but how comes?

LoadVariables
Hi,

I have a problem with loadVariables.

In the first frame, I try to execute the script counter.php
In the second and third frames I check, if I receive the variable “hits”

The variable “out” is a text box and “loop” is only a counter. “hits” is the variable I want to receive

See my short code description:


Frame1:



loadVariables("http://mitglied.lycos.de/fcneptun/c/counter.php"+"?ran="+random(9), "", "GET");



Frame2:



out = ++loop + ") Waiting .... hits: " + hits;



Frame3:



GotoAndPlay( 2 )




OK, If I try the MC local on my test computer, it works perfect . But if I put the MC on my web space, it don’t works !!!!! My web space is on a different provider “members.aon.at”. My be is this the problem????

Please help!

Thanks
David

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