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




LoadMovie, Preloader And Passing Vars?



Hey,

I'm loading an swf with the following code:
code:
this.createEmptyMovieClip("cont", 5);
loadMovie("test.swf", cont);



Now I was wondering if it's possible to make a preloader that starts preloading the movie when the loadMovie function has been called (will be a button). How would I do this?

SaphuA



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-26-2004, 03:08 AM


View Complete Forum Thread with Replies

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

Passing Vars With LoadMovie
I did a search, and either the results didn't fit what I was trying to do, or I didn't understand. I'm fairly new to AS.

I have this function (below) which loads an external swf.


Code:
function showMainContent(section, otherVar) {
this.createEmptyMovieClip("mc", 300);
mc.loadMovie(section+".swf");
mc.q = otherVar;
}
My question is how would I access the variable "q" from the external swf loaded.

In the external swf, I've tried using _parent.q, _parent.mc.q and other combinations. For now, I just have a trace in the external swf to see if the var shows up. What am I doing wrong? Thanks!!

PLEASE HELP - Passing Vars Through MC
Hi!

Simple question.
I have MC that is called by this:
<param name=movie
value="/images/navpanel.swf?what=destination&whatID=1&lang=EN">
embed tag is the same.

Now, I have in the MC Action script following
onClipEvent (enterFrame) {
if (menu.done == undefined) {
menu = new Object();
tree = new XML();

tree.load("/assets/navpanel.cfm?what="+what+"&whatID="+whatID+"&lang= "&lang)
;
menu.done = false;
}
if (tree.loaded && menu.done != true) {
makeFlashVars();
menu.done = true;
}
}

The problem is - MC is not passing the parameters through.

If I change all '+' in URL query string to '&' - then the movie content is
not showing
And if I put all '+' then parameters are not shown.

HELP!

How to define variables so that they are loaded from HTML and then passed
through to another XML.

Passing Vars Via A URL
I'm pretty sure this should work but I must be doing something wrong

I have an swf/html file.

test.html

If I want to send some vars do I just do test.html?var1=1&var2=2 ??

Also if I want to display the vars, can I just set up a dynamic textbox called var1 or var2?

thanks

Passing Vars Between Swf's
I remember that there is an un-mentioned flash mx function to pass variables between .swf's. Can anyone tell me which one it is & if there is a tute available?

Passing PHP Vars Into An MC
Hi all,
I am having trouble passing a PHP variable into an MC in my flash movie. When i have my contact form on the root all variables are passed perfectly but when I load the contact form into an MC the variables from the PHP file are not passed into flash. I tried adding _root.mcname in front of a couple things in the PHP file but this did not work. The section of code I am having trouble w/is below. Thanks.


PHP Code:



//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thanks $yourname for refering a friend! You and your friend will receive a confirmation email shortly.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";

endif;

?>

Passing Vars
I have a game that has each level in a seperate SWF. It loads the first level and plays it. When level 1 is complete, it then loads the second one, and so forth. Now I want to pass variables from each SWF such as the score, lives left, etc. The problem is I am using Actionscript to play music in the background (mySound.start). This allows me to fade the music, loop it from a certain point in the song and such. But it only works if I load the SWF into _level0, otherwise it is just silent. So how can I pass variables to the next SWF if it is in _level0? Thanks in advance.

Help Passing Vars From Url
Hi there. I'm still rather new to flash and I was wondering if anyone could help. i'm making buttons for a website and I'm trying to make it just one button and calling it with

button.swf?text=whatever&link=wherever

where text is what the button displays (got that working fine) and link is where it links to. I just cannot get this to work. Any suggestions? I'm currently using:

on (release) {
getURL (link ,"_framename");
}

I also tried:

on (release) {
getURL ("http://www.site.com/" link ".php", "_framename");
}

but it's just not working Can anyone tell me how to pass the variable into the geturl? it works with just link, but as soon as you put a . in there, it won't load.

Passing Vars From Out An MC
Hi guys,

Please help, im so close too launching this laptop out the window and that cant happen as i sold my soul to get this thing.

Right, Im trying to make a simple email - php booking form. Got a tutorial and all was working fine until....

I need this form in a movie clip but all these tut's come on the main stage.

So this is fine i thought, just add in the path like always with the _root.MCname.form. blar blar....

But no, for some reason i can't seem to get these damn vars out to the PHP file.

I even can't seem to make the onClipEvent go to the next frame in 'thecontent' MC.

onClipEvent(data){

_root.thecontent.nextFrame();
}

All i changed from the original tut was 'thecontent' between _.root and nextFrame();

Am i being a fool wit al this or what peep?

hope someone can help me.

Thanks for listeing ;)

Passing Vars Via Url From .swf To Php?
I am not sure how the heck this would work, I have successfully made the swf file, but I can't seem to pass any variables to it.

What I am trying to do is make a dynamic signature for use in phpBB3 forums.

I have a php script that reads a database and sends the variables to the swf (This works) but I can't for the life of me figure out how to get the swf to accept that ?un= as below, as well as to pass it on to the php script


Code:
[flash=500,150]www.mysite.com/flash_siggy.swf?un=pyrael[/flash]
The Idea is to have the flash pass on the username to the phpscript, and in turn the phpscript would query the db and return the stats variables back to the swf.

here's what little AS1/2 code I have in the swf right now:


Code:
var userVars = new LoadVars();
userVars.onLoad = function(ok) {
if (ok) {
user_txt.text = userVars.username;
}
};
userVars.load("stats.php");

var teamVars = new LoadVars();
teamVars.onLoad = function(ok) {
if (ok) {
team_txt.text = teamVars.team;
}
};
teamVars.load("stats.php");

var trankVars = new LoadVars();
trankVars.onLoad = function(ok) {
if (ok) {
trank_txt.text = trankVars.trank;
}
};
trankVars.load("stats.php");

var ppdVars = new LoadVars();
ppdVars.onLoad = function(ok) {
if (ok) {
ppd_txt.text = ppdVars.ppd;
}
};
ppdVars.load("stats.php");

var pointsVars = new LoadVars();
pointsVars.onLoad = function(ok) {
if (ok) {
points_txt.text = pointsVars.points;
}
};
pointsVars.load("stats.php");

var wusVars = new LoadVars();
wusVars.onLoad = function(ok) {
if (ok) {
wus_txt.text = wusVars.wus;
}
};
wusVars.load("stats.php");

var wrankVars = new LoadVars();
wrankVars.onLoad = function(ok) {
if (ok) {
wrank_txt.text = wrankVars.wrank;
}
};
wrankVars.load("stats.php");

The php script is returning a text string to the flash like such:

username=pyrael&team=13285&ppd=1806&points=213556& wus=691&trank=61&wrank=13467

Any Ideas would be much appreciated

Thanks in advance

Py

Passing Vars From One .swf To Another
I have a main .swf (a shell) that loads in external .swf files. I need to pass a variable from the main shell to an external .swf that is being loaded into a MC in the main timeline.

How do I do this?

loadVarsNum?
loadVars?

myVar = someVar (in the main timeline)
loadVarsNum (in the external file)

Passing Vars From A SWF To New SWF
Hi there

I think this should not be a big deal, but I do not get it to work...

I got a "MainFlash" witch loades an XML with about 60 variables (Settings), in base of a paramater then this "MainFlash" loades another "FlashMovie" and this one needs, all, the same Variables too.

How do I properly pass all the Vars in the new/other "FlashMovie"?

U need to know
> I use LoadMovieNum to Level 0
> I do replace the "MainFlash", cause the new loaded "FlashMovie" can have a completly different height and width ( ...I don't think it's possible to change the Document-Setting in a compiled swf, or is it? If this is possible I would not need to load a separate swf to Level 0...)
> the main SWF usually ist about 320x180, the following can be 2x, 3x bigger...

Can someone give me an helping hand with this?
Or has anybody an other idea?

I'm doing this with MX2004, but then want to use it in FLASH8 too

Regards from Switzerland

Thanx BoF

Passing Vars From One .swf To Another
I have a main .swf (a shell) that loads in external .swf files. I need to pass a variable from the main shell to an external .swf that is being loaded into a MC in the main timeline.

How do I do this?

loadVarsNum?
loadVars?

myVar = someVar (in the main timeline)
loadVarsNum (in the external file)

Passing Vars To Flash
Hi I'm using flash MX and
having some difficulties getting a flash form to "Read" vars from an asp page.
Basically the asp checks if a user name is allready in use
, then creates the vars that tell the movie to goto "success" or "Failed" parts of the movie
this is the asp code that is giving me trouble:

<%@LANGUAGE="JAVASCRIPT"%>
if(!rsUserName.EOF)
{
Response.End
Response.Write("iFailed=1");
}else{
Response.Write("iSuccess=1");
}
%>

I've tried it without response.write e.g just iFailed=1
still doesn't work.

I'm sure it's somthing to do with the vars because if a user name is being used it doesn't perform the task after the Response.Write("iFailed=1");
If the user name is not in the db then it works (performs the tasks in the script) but always sends flash to the failed part of the movie
what am I doing wrong?

In Flash:
frame 1.
// Quantity of time to allow (in milliseconds) for variables to load.
qTimeOut = 3000;
// Quantity of retries (after initial try).
qRetry = 2;
stop();
---------------------------------------
This code is attached to button:
on (press) {
MM_insert = "true";
iSuccess = 0;
loadVariablesNum("http://localhost/myfolder/form.asp",0, "POST");
nTimeStart = getTimer();
nRetry = 0;
play();
}
--------------------------------------------
frame2.
play();
-----------------------------------------
frame 3.
nTimeElapsed = getTimer()-nTimeStart;
if (!(Number(iSuccess)) && nTimeElapsed<qTimeOut && nRetry<qRetry) {
gotoAndPlay(_currentframe-1);
} else if (!(Number(iSuccess)) && nTimeElapsed>=qTimeOut && nRetry<qRetry) {
nTimeStart = getTimer();
++nRetry;
gotoAndPlay(_currentframe-1);
} else if (!(Number(iSuccess)) && nRetry>=qRetry) {
// frame with you have submitted unsuccessfully message
gotoAndStop("Failed");
} else {
// frame with you have submitted successfully message
gotoAndStop("success");
}
-------------------------------------------------
in frames 4(success) & 5 (Failed) stop()
Hope fully there's some one here who can help
Thanks in advance.
Royse

Passing Vars From SWF To SWF Problem
Pardon me if this has been answered. I Looked but didn't see it . .

Anyway . I have one swf that loads another using:

on (release) {
loadMovieNum ("t01.swf", 0);
}

this loads the second swf file fine. Now I want to have a button at the end of t01.swf that passes a variable back to the first swf file. I have tried using on my button:

on (release) {
loadMovieNum ("mm.swf", 0);
}

it goes back to the first movie . . if I tell it to post or get variables, it crashes and will not go back to the first swf file ( mm.swf) . .how can I pass a variable say "UserID=3" from t01.swf to mm.swf and have it work?

Thanks.

Phil

PS - I can make it work in HTML pages . but was trying stand-alone


[Edited by PhilGIllis on 08-13-2002 at 09:33 PM]

Passing Vars From Functions
I have an x.sendAndLoad(URL) call that sends a password to a PHP script, which returns the contents of my address book as name/value pairs if the password was correct.

I then use a x.onLoad = function() to check when the results are in, and gotoAndPlay the next frame.

Within the onLoad function I can access these name/value pairs fine, using either this['name'] or x.name, but the problem is I can't seem to reference them from outside the onLoad, or in the next frame, where they are undefined.

Can someone please tell me how to do this?
Thanks,

Passing Vars To An Exteranl Swf?
Hello,
Is there a way to pass vars to a swf from an another one?

Like if i got a var into my main swf, and into this one i use a loadmovie other.swf
which code should i use in the other.swf to retreive the var from the main.swf?

Passing Vars From Flash 4 To Mx
hi all
i have a flash 4 movie i want to integrate it in a mx 2004 movie the problem when i integrate it mx 2004 don't recognize syntaxe like this

PHP Code:



tellTarget ("C2/M") {
        gotoAndStop(/Colors:m);
    }




well the idea is to generate the swf then i will integrate the swf file in the mx 2004
i have a var that i want to get from the swf i try to use _global it don't accept it what to do???

Passing Vars To Next Scene
Quick question:
If you declare a variable on _root of the first scene...does the variable get transferred to the next scene?

Appreciate any advice.

Help Passing Vars From Flash To PHP
I am trying to do something that is probably very simple, but I am having the toughest time.

I am simply trying to take 2 text inputs in flash (1 var is called username and the other called passwrd).

I simply want these variables to POST to a page called login2.php

I also want to first check to see if either of them is empty.

Here's what I have so far and it does not seem to be sending my variables. I think my code doesn't know exactly where my text inputs are because if I leave the fields blank, it still goes to the page.


Code:
on(release, keyPress "<Enter>"){
auth.txtuser = _root.closemovie.acctLogin.username.text;
auth.txtpass = _root.closemovie.acctLogin.passwrd.text;
if(_root.closemovie.acctLogin.username.text == "" || _root.closemovie.acctLogin.passwrd.text == ""){
_root.errormsg.gotoAndPlay("back");
} else {
_root.closemovie.gotoAndPlay("away");
_root.loginmovie.gotoAndPlay("back");
trace(auth);
auth.send("login2.php","_blank","POST");
}
}
My button and both my inputs all sit inside of a movie clip. Why doesn't this work?!

You can see it in action here: http://files.blasterstudios.com/hgs/site/

Passing Vars From ASP To Flash
I have an ASP page that creates a text file on the server, then I have a Flash application that is supposed to load that text file. Is there a way I can pass the name of the text file from my ASP page to the Flash application?

Passing Vars Between Classes
Just got my brain around broadcasting from one class to a listener in another, but how do I send a var with the event dispatch to the listener?

Thanks

Passing Vars To An Loaded In Swf
Hey there just started playing with the loadmovie option to load a few different movies in at one.. different content..

I want to pass some vars across to the loaded in movie.. and i can't remember how do to do it..

any ideas guys driving me nuts..

made this simple tester down here to show you what i'm trying to achieve.

i'm prob referencing it badly,

Andy.



Code:

activateGameArea = function(){
_root.main.createEmptyMovieClip("game_play_area",main.getNextHighestDepth());
_root.main.game_play_area.loadMovie("game_area.swf",_root.main.game_play_area.getNextHighestDepth());
fadedown(_root.main.game_play_area,0, 100, 1);
//Mouse.hide();
//mouseTrack_mc.startDrag("true");
origX = _root.main.game_play_area.mouseTrack_mc._x;
origY = _root.main.game_play_area.mouseTrack_mc._y;
_root.main.game_play_area.mouseTrack_mc.onPress = function() {
this.startDrag();
};
_root.main.game_play_area.mouseTrack_mc.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == trash_mc) {
this._visible = false;
} else {
_root.moveup(this,"_x",this._x,origX,2);
this._x = origX;
this._y = origY;
}
};
};
activateGameArea();

Problem Passing Vars
I've been having a problem passing a variable from html to my flash movie. I've tried both flashvars and writing it in the embed scr= tag and neither will work. I was wondering if the new .js file that the swf exports with is messing with things.

Please help. I don't know what I'm doing wrong.

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="980" height="850" id="test3" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="false" />
<param name=movie value="test3.swf?btn9hit=true">
<param name="quality" value="high" /><param name="bgcolor" value="#000000" />
<embed src="test3.swf?btn9hit=true" FlashVars="btn9hit=true" quality="high" bgcolor="#000000" width="980" height="850" name="test3" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
<param name="FlashVars" value="btn9hit=true">
</object>

Passing Vars In AS3 Without Using URL String?
Hello,

I have one AS3 swf (loader.swf) that needs to load a second AS3 file (main.swf).

loader.swf has some variables that I would like to pass to main.swf.

I don't want to append the variables in the URL string, because then main.swf won't be cached properly.

In AS2 I could use FlashVars, which passes the variables without adding them to the URL string.

How can I do this in AS3?

Passing Vars From Flash To Php
I know how to pass vars from php to flash and from flash to a new php page but here is my question.
I have a php page (page1.php) with a variable called $number. page1.php also has an embedded test.swf movie. While working with the test.swf movie, I want to send data back to the $number var on the page1.php without reloading the page1.php because then it would reload the test.swf movie.

I have been able to use javascript to change background colors and other items on page1.php from within the test.swf movie but cannot figure out how to set a php variable from within the test.swf movie.
Is this possible?

Passing Vars Through A Function?
I am trying to pass a var through a function, but I keep getting undefined? The problem lies in this line: "_root.infoBox.nameTxt.text = Name[this.buttonID];" ....if I change "this.buttonID" to 0 or 1, 2, 3, etc.. it pulls in the information... But only that one though..

Any thoughts out there?

Here is a down sampled version of the code:


ActionScript Code:
var beginner:Number = _global.beginnerRuns.length;
for (i=0; i<beginner; i++) {
    _global.Name[i] = _global.beginnerRuns[i].childNodes[0].childNodes;
    _root.trailBarMC["trailTxt" + i].buttonID = i;
    _root.trailBarMC["trailTxt"+i].onPress = function () {
        loadTrail();
    };
    //
}
//
function loadTrail() {
    _root.attachMovie("infoBox", "infoBox", 100, {_x: _root._xmouse, _y: _root._ymouse, _alpha: 100});
    _root.infoBox.nameTxt.text = Name[this.buttonID];
}


Thanks!!!

Passing Vars From Fla (ActionScript3) To Php
Hi there...

Is there someone who knows how to pass variables to php? I searched forum, tried all of the script with no luck...

php
<?php
echo $_GET[VariableFromFlash];
?>

fla
function dataSent( event : Event ) : void{
trace( event.target.data )
}
var url : String = "http://www.domain.com/SomePHP.php";

var sendVars : URLVariables = new URLVariables();
sendVars.VariableFromFlash = VariableFromFlash;

var request : URLRequest = new URLRequest( url );
request.data = sendVars

var loader : URLLoader = new URLLoader();
loader.addEventListener( Event.COMPLETE, dataSent );
loader.load( request );

thanks

AS3: Passing Vars Between SWFs?
I'm working on my first AS3 project so sorry about asking such a simple question.

I have a "parent" SWF with an empty loader object. Into that loader object I'm loading an external "child" SWF. That part works. Problem is that I can't seem to get the parent and child to pass variables back and forth.

This is all timeline-based rather than class-based, so I think I just need to figure out the proper scopes to send variables between the two files.

Any suggestions?

Thanks!

NT7

Passing Vars To Addchild .swf
hey guys, I'm a recent AS2 convert and am having some trouble!

I am loading child.swf into parent.swf and need to pass some values to child.swf that are defined in the parent.swf.

In AS2 I just loaded the child.swf into an empty movie clip and referenced the desired values via _root.

any ideas as to how i can accomplish this?

my code thus far....


ActionScript Code:
function stm(event:MouseEvent)
{
    var DataFN:String = fileN;  //value that needs to be passed

    var clip = new Loader();
    addChild(clip);
    clip.load(new URLRequest("child.swf"));
}
send.addEventListener(MouseEvent.MOUSE_DOWN, stm); //button called send to trigger

Passing Vars Across Domains
All I'm trying to do is pass variables to an asp page that's on another domain.


Code:
total_overall = 10;
_root.percentage.text = Math.round((total_correct/total_overall)*100);
_root.percentageSend = Math.round((total_correct/total_overall)*100);
if (total_correct == null) {
_root.total.text = 0;
} else {
_root.total.text = total_correct;
}
// here's where you specify the passing percentage
if (visited) {
// information has already been sent
} else {
if (_root.percentageSend==100) {
trace("your results have been submitted");
quiz_id = 1014;
quiz_1014 = "passed";
// getURL("process.asp", "_blank", "POST");
System.security.allowDomain("http://2appl-telecomweb.intranet.teldta.com");
loadVariablesNum("http://2appl-telecomweb.intranet.teldta.com/quizConnector/process.asp", 0, "POST");
visited = true;
} else {
trace("your results have not been submitted");
// don't submit your results
visited = true;
}
}
As you can see I've tried implementing the System.security.allowDomain script but I still see the Flash player pop-up warning stating that this is a potentially insecure operation. Is there anyway around this?

No Vars Passing Through A Mask
Just registered. First post. Hope it's clear enough.

I'm having trouble passing some vars. I have an MC that duplicates and populates itself based on some arrays. The MCs stack vertically and when clicked move out of the way and show another MC that has a couple of the same fields and a couple of new fields.

When the layer that holds my MCs is not masked this works fine.

With a mask over the layer, the first stack of MCs and their vars fill in fine but when the any of these MCs is clicked the new MC moves in place, but most of the vars don't populate. There are two vars that use loadmovie to put an image and a sound file into contatiners--these come in fine, but the text vars don't come in.

Here's some code.


ActionScript Code:
//# of data fields
count = 1;
//setting arrays
var years = new Array(count)
years[1] = ""

var titles = new Array(count)
titles[1] = ""

var artists = new Array(count)
artists[1] = ""

var roles = new Array(count)
roles[1] = ""

var albart= new Array(count)
albart[1] = ""

var mp3nameone= new Array(count)
mp3nameone[1] = ""

var mp3one= new Array(count)
mp3one[1] = ""

var mp3nametwo= new Array(count)
mp3nametwo[1] = ""

var mp3two= new Array(count)
mp3two[1] = ""
// done with array setting
locale ="_root";
for(i=1;i<=count;i++){
    with (eval(locale)) {
        photo.clip.duplicateMovieClip("clip"+(i+0), +i)
        clipheight = eval(locale).photo.clip._width + 2
        photo["clip"+(i+0)]._x = eval(locale).clip._x +clipheight * i
        photo["clip"+(i+0)].years = years[i];
        photo["clip"+(i+0)].titles = titles[i];
        photo["clip"+(i+0)].artists = artists[i];
        photo["clip"+(i+0)].roles = roles[i];
        photo["clip"+(i+0)].artpath = albart[i];
        photo["clip"+(i+0)].mp3nameone = mp3nameone[i];
        photo["clip"+(i+0)].mp3nametwo = mp3nametwo[i];
        photo["clip"+(i+0)].mp3one = mp3one[i];
        photo["clip"+(i+0)].mp3two = mp3two[i];
        photo["clip"+(i+0)].albart.loadMovie(albart[i]);
        photo["clip"+i].onPress = function() {
                photo._x = photo._x - 250
                btn_back._visible = true
                //advance battery
                _root.batteryvar = _root.batteryvar + 1
                battery.gotoAndPlay(_root.batteryvar);
                //pass these vars to fullcontent1
                full_content1._x = -10
                full_content1._visible = true
                full_content1.year = this.years;
                full_content1.albtitle = this.titles;
                full_content1.artist = this.artists;
                full_content1.role = this.roles;
                full_content1.detail_loader.load(this.artpath);
                if (this.mp3nameone == "") {
                    full_content1.songnameone = "No Song File Available";
                    full_content1.songclipone = "";
                } else {
                    full_content1.songnameone = this.mp3nameone;
                    full_content1.songclipone = this.mp3one;
                }
                if (this.mp3nametwo == "") {
                    full_content1.songnametwo = "No Song File Available";
                    full_content1.songcliptwo = "";
                }else{
                    full_content1.songnametwo = this.mp3nametwo;
                    full_content1.songcliptwo = this.mp3two;
                }
 };
}
}

Passing Vars In Flash
Hi
Is it possible to post vars in flash when pop up windows is closed?

Vars Passing Incorrectly
Hi All,

I have a problem with vars being passed incorrectly from one flash to another. Here is the AS:


ActionScript Code:
function GeneratePortfolio(portfolio_xml) { var portfolioPictures = portfolio_xml.firstChild.childNodes; number.text = "You have saved "+portfolio_xml.firstChild.childNodes.length+" of 15 saved items."; for (var i = 0; i<portfolioPictures.length; i++) {  var currentPicture = portfolioPictures[i];  currentThumb_mc = cartloader.createEmptyMovieClip(instanceName="thumbnail_mc"+i, i);  currentThumb_mc2 = currentThumb_mc.createEmptyMovieClip(instanceName="thumbnail_mc2"+i, i);  currentThumb_mc._y = i*thumb_spacing;  currentThumb_mc._xscale = 50;  currentThumb_mc._yscale = 50;  currentThumb_mc2.attachMovie(currentPicture.attributes.style, movieclip3, getDepth()+2, {bagsname:currentPicture.attributes.bagName, fillColorOne:currentPicture.attributes.one, fillColorTwo:currentPicture.attributes.two, fillColorThree:currentPicture.attributes.three, fillColorFour:currentPicture.attributes.four, fillColorFive:currentPicture.attributes.five, fillColorSix:currentPicture.attributes.six, fillColorSeven:currentPicture.attributes.seven, fillColorEight:currentPicture.attributes.eight, fillColorNine:currentPicture.attributes.nine, fillColorTen:currentPicture.attributes.ten, imagefile:currentPicture.attributes.image, imagexcoord:currentPicture.attributes.xcoord, ycoord:currentPicture.attributes.ycoord});  currentThumb_mc2.onRelease = function(){   getURL('/marty/viewer.swf?file=' + currentPicture.attributes.style + '&bagName=' + currentPicture.attributes.bagName + '&fillColorOne=' + currentPicture.attributes.one , '_blank');  }


So basically, that script above lists different bags dynamically depending on the value passed by the xml. I want to be able to have a user click on the bag, sending them to a new URL with the variables for that specific bag in the address bar. This is working, sort of. Its sending them to a new URL with variables in the address bar, but the variables are of the final node of the xml, rather than the xml node that the bag represents, if that makes any sense to you.

Anyone know how to achieve this?
Thanks,
Mat

Passing Vars To Flash In PhP
We have "hundreds" of artists. (music)
Each artist has his own dedicated page.
We write ONE page in PhP as a template for all artists.
PhP builds the page using just a reference (ARef) and send the HTML.
On the page is an embedded flash player.
The player must load a song extract located in ../ARef/
How do I pass ARef parameter to the embedded flash 8?

Could not find a way in this forum, nor in the help...
Any idea would be much appreciated.

Passing Vars To JS In Popup
does anyone know how i can pass vars to Javascript in a pop-up window?

why?: im going to have all these images and clicking on each window is going to trigger a pop-up with a bigger view of that image, but instead of have a million pages for each image, i want to use just one page and pass a var to JS and then the page just loads the appropriate image.

Passing CF URL Vars To Flash MX Swf
I'm a Coldfusion guy trying to figure out Flash...  I've been playing with an example that uses a CFC that makes a call to the database.  I want to pass 3 variables to the SWF.

The display page is framed - one side is a SWF and the other plain HTML (cfm).  A click on the html page will send the vars to the already loaded SWF - it should just talk to the database and display the results. Simple, huh?

How do I pass these variables into the loaded SWF?  Any recommended books that may discuss this?

Thanks.

AS 2.0 Passing Vars Into A Class
Ok, I'm having trouble figuring this out. I'm trying to make a Scroll Bar and this is what I have.

A MovieClip in my Library with the Identifier set to ScrollBar, the AS2.0 Class set to ScrollBarControl and Export for ActionScript checked.

Inside of ScrollBar, are my objects needed for creating the scroll bar (buttons and things).

I drag out the scroll bar onto the stage and i want to tell it which textfield to scroll. If its already on the stage how can I pass which textfield it is into it?

When I trace it inside of my class it says undefined, unless I hard code inside my constructor which text field it is.

Any ideas??

thanks, khamstra

Passing Vars To A Function
yeah I know how to pass vars to a function, what I need to know though is how to pass a var to a function in this way


ActionScript Code:
function bla(var){
trace(var);
}
 
button.onRelease = bla("blabla");


I know this doesnt work but is there any way to make this work?

Tnx

Passing Vars Through Time
I have a button on the main time line

button1.onRelease = function (){

if (label == false);

pages.gotoAndPlay("start");

}else{

stop();

}
}

this works great of my start anim is on the main time line, however i like to put all my page animations in a MC called pages and set the labell to true or false in the pages MC.

However because the button is on the main time line the var label = true/false can't pass through the different time lines
and i can't do e.g. _parent or _root.var label = true;

Any ideas?

Your help is welcome as always :)

Passing PHP Vars To Flash
Hello All,

I need to pass securely some PHP session variables to a Flash movie.
Does anybody know how to achieve this ??

(PS. I don't want to insert any code in the object tag or any extra code in the url)

thx

Passing In Secure Vars
Hi there,

Can would I go about passing a secure vareable into flash from a .txt file?
I was looking into MD5 with a hidden word, but flash doesn't have MD5 and the actionscript code can easly be found.
Simply all i'm looking to do is pass a four digit number into flash from a .txt file that I dont want anyone else to see?..

Passing Vars With Url -- Intergers?
i'm passing variable in a url string to a swf like blah.swf?hour=12&minute=43, but the swf is interperting the variables as a string rather than an expression? how can i pass those vars as intergers so my math will work on them? thanks. alligator

Passing Vars To MX Text Field From PHP
if I am loading vars into a swf and I have a text field named myText. The var I am loading is called

&myText="This is my text bla bla bla"

Do I have to assign that text field to a variable or is it enouph to just to have named it. or do I need to send my variable as

&myText.text="This is my text bla bla bla"

to have it show up in the text field.

Uggg

Thanks

Flash And PHP - Passing Vars From Nested Mc`s
i there,
i`m passing variables from Flash to php.
This works so far (if they are on _root) - but i`ve some variables that are in nested inside other mc`s or they are inside some duplicated mc`s,
i won`t see them.

What`s the syntax for php to get these variables?

can any one point me in the right direction?

Passing Vars To A Swf In A Popup Window
I am having a devil of a time with this...


I want to have my swf pop-up a javascript window with a swf in it and pass variables to it.

this is the code to launch the popup:


Code:
on (release) { getURL("javascript:window.open(popup.html?desc=test','School','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no, width=280, height=260')", "GET");
}


I then have this line in my popup.html swf:


Code:
desctext.text = _root.desc+" HEY!";


the dynamic text box (desctext) shows" undefined HEY!". AARRGH!!

any ideas??

thanks

MC's And Passing Vars To Main Timeline
Ok, I think I am doing something stupid. Here's the story. I have a movie that is 4 frames long. On the first frame there are input boxes and when values are entered and the submit button is clicked, they get passed to the 2nd frame and things happen...works great...until...

I wanted to allow the user to print each frame separately, so I added a print button to each frame and labeled each frame with #p. So, in order to print ONLY the first frame from the print button on that frame, I was forced to put everything on frame 1 into an MC. Now that I've done so, none of the vars are passing to the second frame.

I went into the code on the second frame and added _root.frame1.blah so it knows where to get it, but still nothing.

Like I said, I am probably just doing something stupid, but can't figure out what. So there are probably a few answers to this question. I could either figure out how to "target" the vars, or figure out a better way to print. Which is easiest? Thank you in advance.

Passing Vars Reloads Movie
I'm trying to pass a variable to a flash movie, like this
src="main.swf?link=1"
The only problem is that even if the main.swf movie has been loaded before, when I pass the variable it reloads it. It kind of thinks that it is a new movie.
Is this sypposed to happen?

Thanks in advance.

Passing Vars From HTML To Flash
I'm trying to send a filename to flash in order to stream that file in question (im streaming CCTV flv video's i've created)


Flash Actionscript

Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

var _vidName = _vidNamevar;
var _vidURL = "http://www.xxxx.com/cammonitor/stream/flvprovider.php?file=" + _vidName;
var _phpURL = "http://www.xxxx.com/cammonitor/stream/flvprovider.php";
var ending = false;
var amountLoaded:Number;
var duration:Number;
var loaderwidth = loader.loadbar._width;

theVideo.attachVideo(ns);
ns.setBufferTime(2);

statusID = setInterval(videoStatus, 200);

ns.onStatus = function(info) {

trace(info.code);
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
ending = false;

clearInterval( statusID );
statusID = setInterval(videoStatus, 200);
}
if(info.code == "NetStream.Buffer.Empty") {
if ( !ending ) {
bufferClip._visible = true;
}
}
if(info.code == "NetStream.Play.Stop") {
bufferClip._visible = false;
//ending = true;
}
if(info.code == "NetStream.Play.Start") {
ending = false;
}
if(info.code == "NetStream.Buffer.Flush") {
ending = true;
}
}

playButton.onRelease = function() {
ns.pause();
}

play_btn.onRelease = function() {
restartIt();
this._visible = false;
}

rewindButton.onRelease = function() {
restartIt();
}

ns["onMetaData"] = function(obj) {
duration = obj.duration;
//trace(obj.width);
//trace(obj.height);
// suck out the times and filepositions array, this was added by flvmdi27b
times = obj.keyframes.times;
positions = obj.keyframes.filepositions;
}

function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * loaderwidth;
loader.scrub._x = ns.time / duration * loaderwidth;
}

loader.scrub.onPress = function() {
clearInterval (statusID );
ns.pause();
this.startDrag(false,0,this._y,loaderwidth,this._y);
}

loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
scrubit();
this.stopDrag();
}

function scrubit() {
var tofind = Math.floor((loader.scrub._x/loaderwidth)*duration);
if (tofind <= 0 ) {
restartIt();
return;
}

for (var i:Number=0; i < times.length; i++){
var j = i + 1;
if( (times[i] <= tofind) && (times[j] >= tofind ) ){
trace("match at " + times[i] + " and " + positions[i]);
bufferClip._visible = true;
ns.play( _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
trace("play " + _phpURL + "?file=" + _vidName + "&position=" + positions[i]);
break;
}
}
}

function pauseIt() {
ns.pause();
}

function stopIt() {
ns.seek(0);
ns.pause();
}

function restartIt() {
ns.play( _vidURL );
}

//restartIt();

// holds sound
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);

var so:Sound = new Sound(vSound);
so.setVolume(100);

mute.onRollOver = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("onOver");
}
else {
this.gotoAndStop("muteOver");
}
}

mute.onRollOut = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("on");
}
else {
this.gotoAndStop("mute");
}
}

mute.onRelease = function() {
if(so.getVolume()== 100) {
so.setVolume(0);
this.gotoAndStop("muteOver");
}
else {
so.setVolume(100);
this.gotoAndStop("onOver");
}
}



/*
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;

var item1:ContextMenuItem = new ContextMenuItem("::::: Video Controls :::::",trace);
theMenu.customItems[0] = item1;

var item2:ContextMenuItem = new ContextMenuItem("Play / Pause Video",pauseIt,true);
theMenu.customItems[1] = item2;

var item3:ContextMenuItem = new ContextMenuItem("Replay the Video",restartIt);
theMenu.customItems[2] = item3;

*/
test.php

Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','380','height','260','src','scrubber','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','scrubber' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="380" height="260">
<param name="movie" value="scrubber.swf?_vidnamevar=golfers.flv">
<param name="_vidnamevar" value="golfers.flv">
<param name="FlashVars" VALUE="_vidnamevar=golfers.flv">
<param name="quality" value="high">
<embed src="scrubber.swf?__vidnamevar=golfers.flv?_vidnamevar=golfers.flv" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="380" height="260" FlashVars="_vidnamevar=golfers.flv" ></embed>
</object>
</noscript></body>
</html>
Now i know this isn't passing a value to the variable as in flvprovider.php i exec("echo $file >> file.txt"); and it returns "/home/www/cammonitor/stream/undefined" but if i set the var within the flash file "var _vidName = 'golfers.flv'" then it returns "var _vidName = _vidNamevar;"

Do i need anything extra in the flash file to define the variable as comming from the url string?

Regards
Liam

[F8] Passing Vars Locally With GrtUrl ?
I'm trying to do this:

getURL("myFile.html?name=myName", "_blank");

but when it launches its just "myFile.html"

Can I not do this?

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