[F8] Need To Change A Variable In A LoadMovie Mc While In Another LoadMovie Mc
So I have a shell mc that has 2 mc's loaded into it with loadMovie (let's call them project1 and project2). While I'm in project1...how do I change a variable in project2 to be true instead of false?I thought I could do it like this (in Project1...):myBtn.onPress = function(){ _parent.dropZone_project2.myVar = false;}Nothing seems to be working. Any insight would be greatly appreciated.
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-20-2008, 11:31 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Change Variable Value With LoadMovie()
I have a main movie with the following script on frame 1:
var test:Number;
this.createEmptyMovieClip("test_mc",2);
test_mc.loadMovie("test.swf");
trace(test);
When I call in test.swf, I want the value of test to change to 1.
In the imported movie, test.swf, I have place the following script on frame 1:
this._parent.test=1;
...
I have also tried (on frame 1 of test.swf) ...
test=1;
_root.test=1;
this.onLoad=function() {
test=1;
};
...
And I've tried declaring test as a global variable using _global.test, but the value is not changing on the loadMovie() command (It returns as undefined).
I have tried all of the above declaring test as a string variable as well, to no avail.
This should be very simple, but for some reason it's not working.
Suggestions???
Thanks to all in advance -
sleepydad
Loadmovie Layer Change
i have a situation where i want a button to load movie into a level for example :
loadMovieNum("home.swf", 2);
when i press another button i want another movie to the same position on the screen, building gracefully ie. swipeing over the last loaded movie...
this needs to happen with various buttons... so is there a way of loading my new movie 1 level above the last level loaded and then moving the loaded movie down 1 level so that the process could carry on infinately..
any ideas guys?
thanks
biscutty
LoadMovie Change Of _root...?
If I have a loadMovie the _root's of the movies I load changes. I was told to put a variable into the movie that changes that, but can anyone explain me where and how??? How exactly is that variable gonna be and where do I put it???
Thanks... :-)
On LoadMovie Change Size
OK I know this is totally a newbie question, but I can't find an answer to it anywhere.
I have a movie clip that I am loading a JPG into, but when it loads the JPG I want it to change size.
I tried putting this in the movie clip that the JPG is being loaded into:
Code:
onClipEvent (load)
{
this._width = 10;
this._height = 10;
}
But it doesn't seem to work I also tried referencing it from another movie cilp, but that doesn't seem to do anything either:
Code:
myMC.loadMovie("addaaddad");
myMC._width = 10;
myMC._height = 10;
Why??
Thanks!
Rick
Change LoadURL To LoadMovie?
I found this menu in the forum..can somebody help me in changing the scripts getURL to loadMovie.
I m done with all my swf's .....i m so close and this is giving me lemons!!!!
colortitle = 0x999999;
colorsubtitle = 0xF7F7F7;
texttitle = new TextFormat();
texttitle.color = 0xFFFFFF;
textsubtitle = new TextFormat();
textsubtitle.color = 0x575757;
titles = ["COMPANY", "SERVICES", "PATRONS","PARTNERS","HOME","CONTACT US"];
subtitles = [["Mission", "Vision", "Goals", "TSI Team", "Awards"], ["Telecomm", "Wireless", "Security", "Consulting", "Web" ]];
URL_subtitles = [["mission.swf", "Test2.html"], 0, ["Test3.html", "Test4.html", "Test5.html"], ["Test6.html"]];
positionor = [100, 121];
//The position of the menu
distance = 25;
//The distance between the menu-items
offset = 10;
//Horizontal offset between the titles and subtitles
createtitlebars();
// ---------------------
function createtitlebars() {
for (i=0; i<titles.length; i++) {
this.attachMovie("bar", "bar"+i, i);
mc = eval("bar"+i);
mc._x = _root.positionor[0];
mc.test.text = titles[i];
mc.test.setTextFormat(texttitle);
myColoredObject = new Color(mc.bg);
myColoredObject.setRGB(colortitle);
mc.old_pos = i*_root.distance+_root.positionor[1];
mc.onEnterFrame = function() {
new_pos = (Number(this._name.substr(-1))<=_root.selected) ? this.old_pos : this.old_pos+_root.subtitles[_root.selected].length*_root.distance;
this._y += (new_pos-this._y)/3;
};
mc.onRelease = function() {
num = Number(this._name.substr(-1));
//specify the actions for the titles like this
if (num == 1) { //0 is the first button, 1 the second,...
//getURL("URLforsecondtitle.html", "_blank");
container.loadMovie("mission.swf")
}
if (pressed) {
if (_root.selected == num) {
_root.selected = titles.length;
pressed = false;
} else {
_root.selected = num;
_root.createsubtitlebars(num);
}
} else {
_root.createsubtitlebars(num);
pressed = true;
_root.selected = num;
}
};
}
}
function createsubtitlebars(num) {
for (i=0; i<_root.subtitles[num].length; i++) {
_root.attachMovie("bar", num+"subbar"+i, i-100);
mc = eval(num+"subbar"+i);
mc._y = _root["bar"+num]._y;
// y-position from where it has to fly in
//you can change this to a number like 200
mc._x = _root.positionor[0]+_root.offset;
// x-position from where it has to fly in
//you can change this to a number like 200
mc.test.text = subtitles[num][i];
mc.test.setTextFormat(textsubtitle);
myColoredObject = new Color(mc.bg);
myColoredObject.setRGB(colorsubtitle);
mc.old_pos = _root.distance*(i+num+1)+_root.positionor[1];
mc.num = num;
mc.onEnterFrame = function() {
new_alpha = (this.num != _root.selected) ? 0 : 100;
this._alpha += (new_alpha-this._alpha)/3;
this._y += (this.old_pos-this._y)/3;
this._x += (_root.positionor[0]+_root.offset-this._x)/3;
};
mc.onPress = function() {
_root.gotoAndStop(_root.URL_subtitles[this.num][Number(this._name.substr(-1))], "_blank");
};
}
}
Change LoadURL To LoadMovie?
I found this menu in the forum..can somebody help me in changing the scripts getURL to loadMovie.
I m done with all my swf's .....i m so close and this is giving me lemons!!!!
colortitle = 0x999999;
colorsubtitle = 0xF7F7F7;
texttitle = new TextFormat();
texttitle.color = 0xFFFFFF;
textsubtitle = new TextFormat();
textsubtitle.color = 0x575757;
titles = ["COMPANY", "SERVICES", "PATRONS","PARTNERS","HOME","CONTACT US"];
subtitles = [["Mission", "Vision", "Goals", "TSI Team", "Awards"], ["Telecomm", "Wireless", "Security", "Consulting", "Web" ]];
URL_subtitles = [["mission.swf", "Test2.html"], 0, ["Test3.html", "Test4.html", "Test5.html"], ["Test6.html"]];
positionor = [100, 121];
//The position of the menu
distance = 25;
//The distance between the menu-items
offset = 10;
//Horizontal offset between the titles and subtitles
createtitlebars();
// ---------------------
function createtitlebars() {
for (i=0; i<titles.length; i++) {
this.attachMovie("bar", "bar"+i, i);
mc = eval("bar"+i);
mc._x = _root.positionor[0];
mc.test.text = titles[i];
mc.test.setTextFormat(texttitle);
myColoredObject = new Color(mc.bg);
myColoredObject.setRGB(colortitle);
mc.old_pos = i*_root.distance+_root.positionor[1];
mc.onEnterFrame = function() {
new_pos = (Number(this._name.substr(-1))<=_root.selected) ? this.old_pos : this.old_pos+_root.subtitles[_root.selected].length*_root.distance;
this._y += (new_pos-this._y)/3;
};
mc.onRelease = function() {
num = Number(this._name.substr(-1));
//specify the actions for the titles like this
if (num == 1) { //0 is the first button, 1 the second,...
//getURL("URLforsecondtitle.html", "_blank");
container.loadMovie("mission.swf")
}
if (pressed) {
if (_root.selected == num) {
_root.selected = titles.length;
pressed = false;
} else {
_root.selected = num;
_root.createsubtitlebars(num);
}
} else {
_root.createsubtitlebars(num);
pressed = true;
_root.selected = num;
}
};
}
}
function createsubtitlebars(num) {
for (i=0; i<_root.subtitles[num].length; i++) {
_root.attachMovie("bar", num+"subbar"+i, i-100);
mc = eval(num+"subbar"+i);
mc._y = _root["bar"+num]._y;
// y-position from where it has to fly in
//you can change this to a number like 200
mc._x = _root.positionor[0]+_root.offset;
// x-position from where it has to fly in
//you can change this to a number like 200
mc.test.text = subtitles[num][i];
mc.test.setTextFormat(textsubtitle);
myColoredObject = new Color(mc.bg);
myColoredObject.setRGB(colorsubtitle);
mc.old_pos = _root.distance*(i+num+1)+_root.positionor[1];
mc.num = num;
mc.onEnterFrame = function() {
new_alpha = (this.num != _root.selected) ? 0 : 100;
this._alpha += (new_alpha-this._alpha)/3;
this._y += (this.old_pos-this._y)/3;
this._x += (_root.positionor[0]+_root.offset-this._x)/3;
};
mc.onPress = function() {
_root.gotoAndStop(_root.URL_subtitles[this.num][Number(this._name.substr(-1))], "_blank");
};
}
}
LoadMovie And Size Change While Loading
i load an external swf file that contains movieClip that cntains a button in it.
i load it to an empty movieClip.
the size of the movieClip and the size of the swf is the same!
but when i see it on screen it changes size!!!!
the width and the height are not the same!!!!
why is that
thnaks in advance
Peleg
Change Stage Size On LoadMovie
I have a base menu loader movie that needs to laod several other movies depending on which link the end user clicks, the base movie is 800x600 but the movies that need to be loaded are 1024x600 so I need to change the size of the actual stage when a movie is loaded at run time. Is there script that can modify the size of the stage itself at run time? The main reason I don't make the main menu movie 1024x600 is because it would then have dead sections all on one side or split on two sides if I move the main loader clip to the center of the 1024x600 stage.
Tahnks in advance
Change Movie Size When Using LoadMovie
I'm pulling in an external SWF (Flash Paper), replacing an existing MC. The MC dimensions are 600x300; however, the Flash Paper SWF is 450x700. Since Flash Paper only creates an SWF, is there a way I can pass credentials in loadMovie to change the size of the Flash Paper SWF? Right now, I've got
loadMovie('newsletter/newsletter.swf', 'newsBox');
Can anything be added in there to dynamically change the size? Thanks!
Loadmovie Change Position Of Movie Clip
I have a box with an animation, when I use the function loadmovie to load a pic over the box it change the position of the movie clip object, where is the problem?
Thanks for the help
Loadmovie With A Variable
What is wrong with this code? why isn't it working?
the screen stays black, no movie is beeing loaded.
Code:
test = "movie_1.swf";
loadMovie(test, 1);
but when i do this it works:
Code:
loadMovie("movie_1.swf",1);
LoadMovie With A Variable
Hi,
Im pretty new to flash and would like to know how i can pass a variable, without any cgi scipts or the like, to the swf i am loading. Basically i want a popup menu on a roll over but this should call a second movie, which contains text, and the text within this will be my variable.
Is this firstly possible, secondly the best method and thirdly will this really save on perfomance and memory or would simply cutting and pasting into the 'over' button area produce a more beneficial result ?
Cheers
Juglugs
LoadMovie Via Variable
I'm trying to load a .swf with a variable that is created by loading a .cfm file. I'm able to load the .swf name into a text field that exists in the _root/main timeline so that I can even see the file name.
But when I try to target the file name in the text field, I get nothing.
On my button I have:
-----------------------------------
on(release){
// load the next swf
var movie = _root.swfmovie;
loadMovie (movie, 0);
}
-----------------------------------
_root.swfmovie is the text field and I can see that the file name loads into it.
I've also tried things like:
-----------------------------------
on(release){
// load the next swf
loadMovie (_root.swfmovie, 0);
}
-----------------------------------
and multiple variations of:
-----------------------------------
on(release){
// load the next swf
loadMovie ("'+_root.swfmovie+'", 0);
}
-----------------------------------
Any reason why a simple variable can't be used to load a movie like this?
BONSAI DOUGLAS
LoadMovie From Variable
Hey
What's wrong with that script. I want to loadMovie, which name is variable. Can it be done somehow? Example code is:
on (release) {
text = this.name;
lastIndex = text.lastIndexOf("
")
s = new String(text);
x = s.slice(0, lastIndex)+".swf";
loadMovie(x, 9);
}
// if i put straightforward string to variable x="MyMovie.swf" it still doesn't work...
Any suggestions?
Variable In LoadMovie
Hey guys I need some help here.
Is it possible to use a variable in the loadMovie command?
here is what I have.
on a button I have this:
Code:
on (press) {
movieurl = "testing.swf";
}
on (release) {
loadMovie(movieurl,100);
}
If I change it to this it works fine:
Code:
on (release) {
loadMovie("testing.swf",100);
}
It seems to me that I cant use a variable in the loadMovie action. any ideas? It is driving me crazy.
Thanks in advance
Felix_Man
Using Loadmovie With A Variable?/
I'm trying to have my code load an external swf....but I want it to be a variable. How do I do this? Do i have to manually type it in, I'm not sure how to go about doing this.
I want to have each button set the variable to whatever external swf, but I need a piece of code that will execute the load command for the variable.
Help??
Thanks.
LoadMovie With Variable
OK..
How can I tell loadMovie URL in variable?
Let's imagine that I want to load myMovie.swf
on (release) {
myVariable = myMovie.swf;
loadMovie (myVariable);
}
<-- That doesn't work but you get the idea...
... and I'm using flash 5.0
Using LoadMovie With A Variable For The URL
Using Flash MX, exporting to Flash 5
Am I losing my mind or is this just not possible?
How come I can load a URL using a variable:
on (release) {
x = "page.html";
getURL(x, _self);
}
but can't load a movie the same way?:
on (release) {
y = "movie.swf";
loadMovie(y, 2);
}
this is simplified code of a more complex function i'm writing to dynamically generate the clip name and convert it to a string (y) for use in the loadMovie function. i've traced my typeof y and then traced y and it returns a string and the appropriate URL for the swf i'm attempting to load.
what gives?
LoadMovie Variable
Hi,
I have got a flash file, which i made up for my uncle, its a basic site with links etc.
i have a analog.swf clock that i want to load (external) on the main section.
When i finally got the analog clock to load where i wanted it, it didnt load?
Source=
http://www.learn-with-tim.com/index.fla
Danny
Loadmovie URL From Variable?
Hi, I'm trying to dynamically build a URL and a textfield Var from a variable created on a button press.
Here's the button action...
code: _root.technology_btn.onPress = function() {
var newSection = "technology";
trace(newSection);
newText();
newImage();
}
and here are the functions it calls...
code: function newText() {
_root.textBase_mc.textContent_mc.title_txt.htmlTex t = _root.contentLoad.newSectionTitle;
_root.textBase_mc.textContent_mc.body_txt.htmlText = _root.contentLoad.newSectionText;
_root.textBase_mc.textContent_mc.body_txt.scroll = 0;
}
function newImage() {
loadMovie("content/images/newSection.swf", "_root.imageContent_mc");
}
How do I get the 'newSection' variable to be part of the loadmovie URL and the textfield Var? I've tried various variations and have got nowhere so far. Any ideas on how to make it work?
Thanks,
Andy
LoadMovie Variable
Hi,
Basically I'm building a flash movie which consits of 4 .swf's on different levels.
How can I use a pre-loader to pre-load all of these movies so that they load in sequence?
Cheers,
Media Monkey
LoadMovie() From A Variable...?
Hi everyone,
I'm having trouble getting loadMovie() to load a SWF from a http:// address when it's stored in a variable.
This works:
Code:
loadMovie("http://devserver/flash.swf", 25);
(I want the swf to load into layer 25)
This doesn't work:
Code:
myDestination = "http://devserver/something.swf";
trace(myDestination);
loadMovie(myDestination, 25);
The trace outputs the correct URL, and the SWF is indeed there at that URL. But nothing happens in the movie.
This code is running in layer 10.
... the reason this has to be done by variables, is that the SWF is drawing its contents and destination URLs (all SWFs) from an external source (XML file). What we're looking at is the button activation code.
Any help, suggestions, or workarounds would be most welcome
Thanks
Jason
LoadMovie Using Variable Rather Than Swf
Hey pros,
can someone help me with this one. I want to use the loadMovie but keep it as a variable rather than a specific swf that loads - does this work as follows....
1. Button press sets variable:
on (release) {
section = "introduction.swf";
}
LoadMovie() With Variable
http://www.somehosting.com/main.swf?SECTION=first
can past the variable of SECTION to loadMovie() ?
loadMovie(section+"01.swf",1);
it should be load first01.swf, but can't.
is it loadMovie can't contain varaible ?
I had add a trace(SECTION) , the output message is undefine , but _root.test.text = SECTION , the textfield can show the value correctly.
thanks in advance for any replies..
LoadMovie With A Variable?
I am passing a variable "var1" from my web page to my flash movie in a loadMovie action.
Making the varaible appear in the flash movie is working as input text or on a geturl string so I can see it passing the right information, but not to the loadMovie action:
I am using this code on scene 1, frame 1, not on a button or movie clip:
loadMovie( "http://www.mydomain.com/"+var1+".swf", 1 );
stop;
LoadMovie With Variable
I have a button that I want to load another movie into level 2. The problem is, the movie it loads is determined by a variable.
on (release) {
loadMovie("star" + _global.star_number + ".swf", 2);
}
When I try this exact same button code with getURL, it works fine!
So for example, if the star_number variable is 11, we should load movie star11.swf
With getURL, it works exactly this way. Change it to a loadMovie statement and BAM, nothing!
I'm using Flash MX. Please help me!
Using A Variable Name In Loadmovie
I currently have a stumper that I cannot seem to figure out.
I am trying to dynamically load a JPG image that is hosted on a server into an empty movieClip.
The URL for the image is stored in a text file as a variable called imageURL.
This works, if I hardcode the URL at the root.
Code:
imageURL="http://www.newtek.com/products/lightwave/tutorials/modeling/superman/superman_main_logo.jpg";
pageNumber = _root.curPg;
loadVariables("txt/p025params.txt", this);
MainImage_mc.loadMovie(imageURL);
However, once I comment out the first line and attempt to pull the variable from the text file instead, the image does not load.
Code:
//imageURL="http://www.newtek.com/products/lightwave/tutorials/modeling/superman/superman_main_logo.jpg";
pageNumber = _root.curPg;
loadVariables("txt/p025params.txt", this);
MainImage_mc.loadMovie(imageURL);
To test that the imageURL variable is correctly being read from the text file, I had created a dynamic text field with the var set as "ImageURL". The text field displays the URL correctly, so I know it is working.
The p025params.txt textfile looks like this:
imageURL=http://www.newtek.com/products/lightwave/tutorials/modeling/superman/superman_main_logo.jpg
Is there something I am doing incorrectly?
I'm wondering if the URL on the textfile is being read incorrectly when it is loaded.
LoadMovie... Can I Take A Variable With Me?
I'm designing a game where the levels are too big to be in one swf. so each level loads up a new movie- but if my wildest dreams came true i would be able to, for example, load level 2 and have it remember how well you did on level 1.
is there any way to do this? to inject a variable from the first movie to the second one after it takes over?
thanks!
How Do I Get A Variable From LoadMovie?
Hi guys!
I'm trying to build an archive for a tri-weekly comic strip on a site I'm building. Because I don't want to have one slowly growing larger swf containing all the comics, I'm using one swf that loads the comic strip swfs into it. To do that I'm using the script:
ActionScript Code:
loadMovie("1.swf",_root.loadStrip);
This is working great, but I have previous and next buttons I'm making so that the user can navigate from strip to strip. I don't want to hard-code the AS for it, so I'm wondering if there is a way to grab the name of the loaded swf (1.swf) so I can write a script to add or subtract "1" from the name and the buttons thus load the next or previous comic strip.
I also need a way for the main swf to load the most recent strip when it comes up.
Thanks guys!!!
Variable In LoadMovie
I've been battling with this for a whole day now. I'm using a database to store information and then calling it back into Flash using a PHP script which outputs all the necessary variables. All the text comes in fine but I'm having difficulty with loading a picture into a blank movie clip (called mcNews_pic).
The picture variable (called news_image) that's output is the JPEG's path - it comes out as: "images/news/news_1.jpg"
The ActionScript that loads in the variables is on the first frame of the movie.
Putting the image path directly into the loadMovie line works fine, but the variable name doesn't seem to work in there...
mcNews_pic.loadMovie(news_image); // doesn't work
mcNews_pic.loadMovie("images/news/news_1.jpg"); // works fine
The variable displays fine in a test text field I've made as well.
Any ideas? It's driving me mad... I'm sure I've done something wrong but whatever I try doesn't seem to work.
I also want to make sure I retain Flash 5 compatibility if possible.
Any help is appreciated!
Cheers,
Andy
Using A Variable Name In LoadMovie
O.K relatively new to Kirupa Forums.. My Question is how can you load a Movie clip with a variable name?? My example is that I have a custom menu with png's that are loaded by XML and I need to load a Different submenu/ content depending on which button i Click... I have no code as I am in the planning stage and Need to know whether this works or not.. Please Help!
LoadMovie Variable URL
Hi,
I apologize if this is amateurish question, but I'm trying to use loadMovie to load an external picture into an empty movie clip. I have the url of the external picture as a variable (complicated reason) in the actionscript, the problem is, I don't know how to get the variable to be used as the URL of the loadMovie. I'd really appreciate some help with this .
Variable In LoadMovie
Hi,
I'm trying to combine PHP/SQL and Flash. I've got a problem now. I want to load a variable that contains an url to an image. so the variable is like this:
http://www.mysite.com/image.jpg
Now I want flash to load the image, not the text. The variable is called 'img1' but the loadmovie function doesn't work when I put it in. Can someone please explain how to do this.
Thnx
LoadMovie(variable); ?
Help me figure this out:
i'm trying to load a movie based on a variable on a new level, but it's not loading...
var songNum = 1;
var songer = new Array("audio_1.swf","audio_2.swf","audio_3.swf");
var songCon = (songer[songNum]);
trace(songCon);
loadMovie(songCon,5);
the trace(songCon); brings up "audio_2.swf", so why isn't the loadMovie command working?
Using Loadmovie With A Variable?
I'm trying to have my code load an external swf....but I want it to be a variable. How do I do this? Do i have to manually type it in, I'm not sure how to go about doing this.
I want to have each button set the variable to whatever external swf, but I need a piece of code that will execute the load command for the variable.
Help??
Thanks.
LoadMovie Variable
Here is an easy question. i am trying to load a movie passed via querry sting but it does not seem to want to work. here is the simple code.
PHP Code:
movieLoad = "aloha.swf"
loadMovie(movieLoad, 1);
stop();
how do i get this to load the sting?
LoadMovie With Variable
I have been searching but haven't found an answer, maybe it's an easy answer.
The AS code is:
loadVariablesnum("noticias.txt",0);
loadmovie(imagen1,"imagen1");
loadmovie(imagen2,"imagen2");
And I have several MC that work as image holders, all are called imagen1,imagen2, etc. In the .txt file I have defined:
&imagen1=myimage.jpg
&imagen2=myotherimage.jpg
As I have been looking around, it should work without trouble.
But when I preview the movie, I get the error:
Error opening URL "file:///C|/myfiles/_level0.imagen1"
Error opening URL "file:///C|/myfiles/_level0.imagen2"
When I publish my movie, the pictures don't appear.
Hope someone can help me.
Thanks
Cesar
Loadmovie(variable)?
Can I just get someone to take a look at this for me?
I have a php script that pulls some variables out of a database:
loadVariablesNum("query.php?id=12", 0);
I get a number of variables from this script, one of which is a var called 'picture'. That variable is typically something like 'image1.jpg'.
What I want to do is this:
_root.imageHolder1.loadMovie(picture);
Ie; load the image name pulled from the database into the movie called imageHolder1. This doesn't seem to work and I don't understand why.
How do I specify the contents of a variable rather than an absolute filename here?
Passing Variable Through LoadMovie
Ok, I'm sure I'm missing something easy here.
Picture this:
I'm loading a movie into _level1 and I want to be able to access the variable from the main timeline. How do I do this? I've tried accessing from the loaded movie:
score=_root.variable; (or some such thing) and I've tried sending the variable to the loaded movie after the movie is loaded:
_level1.score=variable;
where am I being stupid?
Thanks.
How Can I Use Variable Names In LoadMovie URL?
I am setting variables when buttons are pressed, which will load an external .swf. Normally I would use a lot of these:
loadMovie("history/image.swf", "/image_loader");
"history" is where I would like to use a variable name, how can I do this?
Using Variable To Trigger Loadmovie
hello-
Im trying to pass a variable into the root flash movie, and have that variable trigger a loadmovie event.
Any help with structure or an example would be appreciated.
thnx - MikeH
Send Variable From SWF To SWF Thru LoadMovie
I want to use a button to load a movie (not movie clip), a new url, and also pass the variable REQUEST into it. Any suggestions?
--------------------------------------------------------------------
Currently I'm using this:
on (release) {
request = "privacy";
loadMovie("pages/termsconditions.swf", "this", "POST");
}
LoadMovie Using Variable Text From ASP
I know this has been done. I can't get it to work, though.
I am using an ASP file with the following line:
billboard1=images/billboard2.jpg&billboard3=images/billboard3.jpg
to feed variables into a flash movie. These variables are to fill in the "URL" portion of the loadMovie script.
I have placed a movie clip instance "sign" that will hold the loaded movie/image in the first frame of the _root timeline. Also in the first frame, I have a loadVariables command to get the variables from the ASP file. On the stage is a dynamic text field called "bb1txt" that displays the variable "billboard1", which is an image path. Here is what the script looks like:
loadVariables("scripts/game_testVariables.asp", "_root");
loadMovie(_root.bb1txt.text, "_root.sign");
The ASP file looks like this:
billboard1=images/billboard2.jpg&billboard3=images/billboard3.jpg
I thought this should have worked!?
Any insight is helpful.
Thanks.
LoadMovie -> Variable Reference
Hi,
I am building a wrapper file to loop a bunch of SWFs I have. The wrapper file loads an XML file within which the user can specify which SWFs they want to include in the loop. However, I need to limit them from specifying any kind of SWF, so in my target SWFs I have a "checksum" variable. I want to be able to verify that checksum in the wrapper to make sure its a valid SWF to load.
So, here's what I did, but it didn't work (as I had expected but I tried anyway):
<code>
loadMovie("blah.swf", targetMC);
targetMC.stop();
checksumValidationInterval = setInterval(validateChecksum, 0);
function validateChecksum()
{
if (targetMC.getBytesLoaded() > 4 && targetMC.getBytesLoaded() >= targetMC.getBytesTotal())
{
clearInterval( checksumValidationInterval);
if (targetMC.LOOP_CHECKSUM == this.LOOP_CHECKSUM)
{
&n bsp;targetMC.play();
}
else
{
&n bsp; // Display the error message
&n bsp; errorString = "'" + movieList[movieTracker].source + "' is an invalid SWF!";
&n bsp; gotoAndPlay("errorDisplay");
}
}
}
</code>
Is this even possible and I'm just doing it the wrong way, or is this impossible to do? Any idea anyone?
Parsing A Variable And LoadMovie
Hi y'all
(semi-newby)
I'm trying to find an efficiant way to write code calling a swf file.
I've got a global varible called 'talent' set (to one of four different options) earlier in the movie and when the playhead reaches a certain frame I want to load a movie based on whatever the variable the user selected.
I don't want to use 'if' statements, because I'm sure there's got to be a more efficiant way.
And I dont want to have the .swf included in the variable because it will also display to the user.
This bit of code (which currently returns an error) will give you an idea of what I'm after:
loadMovie('("talent"+"_hi.swf")','content_holder')
How do I get Flash to parse ("talent"+"_hi.swf") so it can be read by loadMovie.
I'm not an uber-coder, but I'm sure there's got to be a way.
hope there's a brainy out there...
Loadmovie Based On _X Variable
hi!
Based on a script from this site i created a scrolling type site like barneys, quannum etc etc..you've seen them..
Now i'd like to load a MC when the site stops at a X variable.
the way i did it doesn't work, so i'm hoping anybody here can help me. I've attached the files to this message in a zip
this is the script:
onClipEvent (load) {
_x = 0;
_y = 0;
velocity = 4;
}
onClipEvent (enterFrame) {
_x += (endX - _x) / velocity;
_y += (endY - _y) / velocity;
if ( _y <= endX ) {
_parent.test.loadMovie( _root.section + ".swf" );
}
_root.item1.onRelease = function() {
endX = 0;
endY = 0;
};
_root.item2.onRelease = function() {
endX = 0;
endY = -638;
_root.section = "mc"
};
}
I hope anybody can help me!!
thnx!!!
rob
Loadmovie On Variable Targets?
Hi Guys,
I'm using the following code to load a variable target into a variable movieclip.
targetClip = "center"
targetSWF = "myimage.jpg"
_root[targetClip].loadMovie(targetSWF);
This works fine but I want to be able to load into childs of
movieClips like this
targetClip = "center.image"
targetSWF = "myimage.jpg"
_root[targetClip].loadMovie(targetSWF);
however that doesn't work!
Any good ideas for a solution?
//poden
[FMX] LoadMovie Pass Variable
I have had a look on here, and it seems that some ppl have tried to do a similar thing to what I am trying - but I guess that they had little, or no, success.
what I want to do is loadmovie a new swf into my video player
so.
vid.loadMovie("new.swf")
but I would also like to be able to pass some info to the player swf. (there are essentially a couple of different types of movie)
is it possible in any way? I have tried a number of things but without success - and my only remaining option is to use some kind of _proto_ variable - which I am also sure won't work.
I think that because if i set the _root._alpha of new.swf to 50 when it's loaded vid._alpha is 100 (despite the actual swf being at 50% alpha)
I should point out that this will not be deliverd by web, but locally, probably by cd-rom, to a machine.
Using A Variable For The LoadMovie Function?
I want to dynamically pull an external .swf into a movie layer based on a users button click. so for example...
user clicks a button....
the movie clip that is playing will go to its closing animation then load this new movie over it.....
i am thinking that the button will set a variable..say (selectedmovie) and the end of each external movie clip will be set up to capture that varialbe in the loadmovie() function.
Can the loadMovie() function accept a variable from a button click in a different movie clip as its movie clip URL???
not sure if this is making any sense..maybe ther is an easier way to do what im trying to do....
thanks
|