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




Passing Movies OnRelease



hey im using the following code for my main four buttons -
Code:
button_array = ["home","plans","terms","contact"];for (var i in button_array){this[button_array[i]].onRelease = function() {_root.fromName = 0;content_mc.gotoAndPlay(36);_root.fromName = button_array[i]+"_mc";};}
but every button restarts the home_mc clip.. i call it like this in the content_mc clip -
Code:
stop();attachMovie(_root.fromName, _root.fromName, 1);
it also gets removed due to a slide down menu refresh everytime a button is pressed. SO i have no idea whats going on



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-16-2004, 08:32 PM


View Complete Forum Thread with Replies

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

Passing Movies OnRelease
hey im using the following code for my main four buttons -

Code:
button_array = ["home","plans","terms","contact"];
for (var i in button_array){
this[button_array[i]].onRelease = function() {
_root.fromName = 0;
content_mc.gotoAndPlay(36);
_root.fromName = button_array[i]+"_mc";
};
}
but every button restarts the home_mc clip..

i call it like this in the content_mc clip -


Code:
stop();
attachMovie(_root.fromName, _root.fromName, 1);
it also gets removed due to a slide down menu refresh everytime a button is pressed.

SO i have no idea whats going on

Passing Var To OnRelease Function
Isn't it supposed to work !!!!

Code:
i = 1;
some_mc.onPress = function(i){
trace(i);
}

seams like i is not passing to the function at all !!!

can anyone explain please ? plus maby some hints how to make it work

Passing Variable Into OnRelease
I'm in need of a little help. I have a simple navigation, and each item is declared in the array below. The corrresponding movie clips also have the same instance name, and when each nav item is clicked, the movie should go to and play a frame that has a label containing the same name.

// names changed for client privacy
var navItems = ["foo", "bar", "hot", "chocolate", "w00t"];

for (i=0; i < navItems.length; i++) {
caseStudySubNav[navItems[i]].onRelease = function(){
gotoAndPlay(navItems[i]); // does nothing
trace(navItems[i]); // traces as undefined
}
trace(navItems[i]); // traces the array values properly
}

Everytime I click a menu item the trace returns as undefined. How do I get the value of navItems as it passes through the array attached/pushed to the onRelease function?

Thanks

Passing Parameters At OnRelease
I have a glossary of many terms contained in a termsArray in the main timeline. The main timeline also has a definitionsArray with correspondingly numbered elements containing the multiline definitions/discussions of the terms in the termsArray .

A glossary list movieClip is called onto the stage from a menu link and displays the terms in a list of columns using dynamic text. In that glossary movieClip, there is a movieClip for each term with an onRelease function to attachMovie(), where the movieClip to be attached (replacing the glossary movieClip at the same depth), uses dynamic text to present the term, its lengthy definition/discussion, and a Back button that onRelease replaces the term movieClip with the glossary list movieClip.

Rather than creating a separate term movieClip for each term, I wish to create a single generic term movieClip that will receive the termsArray element number and definitionsArray element number associated with the term that was clicked, and to populate the termArray with dynamic text accordingly.

I don't know how to pass the termsArray and definitionsArray element numbers to the generic term movieClip when the corresponding term is clicked in the glossary movieClip.

Can you advise? Thank you.

Passing Array Element Value To MC OnRelease
The attached code is intended to present a glossary of terms, such that the terms list appears in the main viewing area in columns (at this stage I'll settle for one column) by using dynamic text via one MC per term. The list of terms is generated by a MC that will be called onto the stage by the Menu and the instance will be at depth 1000 as "content_mc". The term MCs are generated dynamically inside of that terms list MC by a "for loop" based on the length of the matrix glossay array of terms and their definitions. When a term is clicked, the onRelease function calls a generic term display MC (shows term and then its defintion) to be attached to the stage as "content_mc" at depth 1000 replacing the list. The term and its definition in the generic display MC are called from the matrix array of glossary terms located in the main timeline. The generic term display MC has a dynamic text link that when clicked, onRelease attaches the glossery terms list MC as "content_mc" at 1000, replacing the just displayed term.

Thigs are going along well except, critically, the termID of the term clicked in the list of terms is not properly formed and/or passed, because the generic term display MC comes up Underfined/Undefined. It works fine if I hard code the glossary mattrix array element in the generic term display MC, but it can't read what I'm sending it in the onRelease.

Any help would be greatly appreciated. Thank you.

If you care to see the FLA (mx2004), it is in an open directory, along with the SWF and an HTM file presenting the SWF at
http://www.trunksite.com/test/

Here is my array from the main timeline (Latin filler text in definitions):


Code:
// To be used in termsList_mc function to identify term to display
var termID:Number
stop();

// CREATE GLOSSARY MATRIX ARRAY: TERMS AND DEFINITIONS

glossary = new Array();

glossary[ 0 ] = new Object();
glossary[ 0 ].term = "TERM_0_Name";
glossary[ 0 ].definition = "TERM_0_DEF: Mei id oratio erroribus, cum at labores voluptatibus. " +
"Mel in omnis admodum oportere, ne quot cibo eos, eu odio novum patrioque per. ";


glossary[ 1 ] = new Object();
glossary[ 1 ].term = "TERM_1_Name";
glossary[ 1 ].definition = "TERM_1_DEF: Eam te impetus definiebas. Ne pri reque graece intellegebat, " +
"assum errem usu ut.";

glossary[ 2 ] = new Object();
glossary[ 2 ].term = "TERM_2_Name";
glossary[ 2 ].definition = "TERM_2_DEF: Id vix graecis explicari, cum luptatum probatus an. Pro ad graecis " +
"dissentiunt. Menandri explicari omittantur in vix, an pri fugit ridens impetus, legere sanctus ":

// END GLOSSARY MATRIX



// Basic Setup
attachMovie("stage_mc", "stage_mc", getNextHighestDepth());
// Other content MCs omitted to visually simplify script for this glossary problem

// Content Setup
attachMovie("termsList_mc", "content_mc", 1000);

Here is my terms list MC from the library:


Code:
// CREATE TERMS LIST

var startY = 125;
var gSpacer = 20;

// Write Section Heading
createEmptyMovieClip("heading_mc", getNextHighestDepth());
with(this.heading_mc)
{
createTextField("tText", getNextHighestDepth(), 210, 85 , 540,30);
tText.HTML = true;
tText.text = "Glossary of Terms";
tText.setTextFormat(_level0.myHead);
}


// Loop to create as many terms as exist in the glossary array
var count = _level0.glossary.length;
for( var i=0; i<count; i++ )
{
// TextField Parameters: ("instanceName", depth, _x, _y, _width, _height)
createEmptyMovieClip("termItem_mc" + i, i+1);
with(this["termItem_mc"+i])
{
this["termItem_mc"+i].createTextField("tText", getNextHighestDepth(), 210, (i*gSpacer + startY) , 260,20);
tText.HTML = true;
tText.text = _level0.glossary[i].term;
tText.setTextFormat(_level0.myBodyAWAY);

// ROLLOVER DETECTION AND TEXT FORMAT CHANGE

this["termItem_mc"+i].onRollOver = function ()
{
this["termItem_mc"+i].setTextFormat(_level0.myBodyOVER);
}
this["termItem_mc"+i].onRollOut = function ()
{
this["termItem_mc"+i].tText.setTextFormat(_level0.myBodyAWAY);
}
this["termItem_mc"+i].onReleaseOutside = function ()
{
this["termItem_mc"+i].tText.setTextFormat(_level0.myBodyAWAY);
}

// LINK ON MOUSE CLICK
this["termItem_mc"+i].onRelease = function ()
{
// ????????????????????????????????????????????????
_level0.termID = i;
_level0.attachMovie("termDef_mc", "content_mc", 1000, _level0.termID);
// ?????????????????????????????????????????????????
}
}
}

Here is my generic term display MC from the library:


Code:
// GENERIC TERM DEFINITION

var startY = 125;
var gSpacer = 20;


// Write Term
createTextField("tTerm", getNextHighestDepth(), 210, 85 , 540,30);
tTerm.html = true;
tTerm.text = _level0.glossary[_level0.termID].term; // ???????????????
tTerm.setTextFormat(_level0.myHead);

// Define Term
createTextField("tDef", getNextHighestDepth(), 210, (0*gSpacer + startY) , 540,360);
tDef.html = true;
tDef.multiline = true;
tDef.wordWrap = true;
tDef.text = _level0.glossary[_level0.termID].definition; // ???????????????????
tDef.setTextFormat(_level0.myReg);




// Link Back To Glosaary List
createEmptyMovieClip( "backToTermsList_mc", getNextHighestDepth());
with ( this.backToTermsList_mc ){

// TextField Parameters: ("instanceName", depth, _x, _y, _width, _height)
this.backToTermsList_mc.createTextField("tText", getNextHighestDepth(), 210, 530 , 540, 20);
tText.HTML = true;
tText.text = "Back To Glossary Terms List";
tText.setTextFormat(_level0.myBodyAWAY);
}
// ROLLOVER DETECTION AND TEXT FORMAT CHANGE

this.backToTermsList_mc.onRollOver = function () {
this.tText.setTextFormat(_level0.myBodyOVER);
}
this.backToTermsList_mc.onRollOut = function () {
this.tText.setTextFormat(_level0.myBodyAWAY);
}
this.backToTermsList_mc.onReleaseOutside = function () {
this.tText.setTextFormat(_level0.myBodyAWAY);
}

// LINK ON MOUSE CLICK
this.backToTermsList_mc.onRelease = function () {
_level0.attachMovie("termsList_mc", "content_mc", 1000);
}

Help In Showing/hiding Movies OnRelease
hi,
I'm not sure what is the best method to accomplish this.. I'm trying to show/hide different content when people click on different menu items. I have five menu items and I created 5 .swf files for them but I don't know how to show the first one "home.swf" first then hide it and show the "gallery.swf" when they click on gallery button.

any best idea to do this?
thanks
P.S a little tutorial or instructions how to do it is appreciated.

Assigning OnRelease To Movies In Loop
Hi, I need help with actionscript.

I'm creating an XML-driven image gallery based on the tutorial here ....
http://www.kirupa.com/web/xml/examples/portfolio.htm

The script counts the number of images, loops according to a set limit of thumbs for each menu page, creates the appropriate number of pages, thumbs and a menu for the page numbers. Everything works fine except the assignment of onRelease to the buttons for the page number menu. This part ....

item_mc.onRelease = function(){
currentPage._visible = true
}

currentPage is being overwritten every time the script loops, so it always ends up making the final page of thumbs visible no matter which button is clicked. What mistake am I making? What's the trick to get the onRelease function to assign and increment to produce the correct action for each button?

And I haven't thought of a way to turn off the pages that aren't selected yet.

Can you help?
thanks
mark

Here's the full script so far ....

// load variables object to handle loading of text
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
description_txt.text = raw_text;
}

function cgstills(cgstills_xml){
var portfolioPictures = cgstills_xml.firstChild.childNodes;

var currentPage = 0
// thumb spacing
var thumb_spacing = 40;
//total number of items
var item_total = portfolioPictures.length
//items per menu page
var item_number = 3
//calculate page total
var page_total = Math.floor(item_total / item_number) + 1
//trace (page_total)
var page_number = 0
// current thumbnail (keeps track of total thumbs processed)
var currentItem = 0
// temp page button spacing
var btn_spacing = 50

// start creating pages
for (page_number = 1; page_number <= page_total; page_number++){

currentPage = menu_mc.createEmptyMovieClip("page"+ page_number, page_number);

// start creatingthumbs
for (i = 0; i < item_number; i++){

var currentPicture = portfolioPictures[currentItem];

var currentThumb_mc = currentPage.createEmptyMovieClip("thumbnail_mc"+currentItem, i);
currentThumb_mc._x = i * thumb_spacing;

currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);

currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.description = currentPicture.attributes.description;

currentThumb_mc.onRollOver = currentThumb_mc.onDragOver = function(){
info_txt.text = this.title;
}
currentThumb_mc.onRollOut = currentThumb_mc.onDragOut = function(){
info_txt.text = "";
}
currentThumb_mc.onRelease = function(){
image_mc.loadMovie(this.image);
description_lv.load(this.description);
}

// increment thumb total
currentItem++

} // end of thumbs

var item_mc = page_mc.attachMovie("item","item"+ page_number, page_number);
item_mc._y = page_number * btn_spacing;
item_mc.btn_txt.text = page_number

// hide current page
currentPage._visible = false;

// add script to item_mc btns

item_mc.onRelease = function(){
currentPage._visible = true
}

} // end of pages

// page1 visible

_level0.menu_mc.page1._visible = true;

} // end of cgstills

// xml object for xml content (defines sources for selections)
var cgstills_xml = new XML();
cgstills_xml.ignoreWhite = true;
cgstills_xml.onLoad = function(success){
if (success)
cgstills(this);
//trace(this);
else trace("Error loading XML file"); // trace error
}
// load
cgstills_xml.load("cgstills.xml");

Passing Variables Between Movies
hey all...

i am a programmer who is new to flash and i am pretty confused about scoping of variables. the immediate problem is as follows:

we have a main movie which calls another movie. the user can then select somethings in the sub-movie. we want to write those choices to a variable in the main movie. the movies are separate to keep the size of the main movie down.

is there any way for movies to share variables other than using text files and a load varaibles call? we tried using javascript and cookies (an ideal situation) but had trouble with ie om mac (we will need to use the setvariable call rather than using javascript to write the page and reloading it).

i am sort of new to flash terminology, so i trying to be as clear as possible.

thanks in advance!

og

Passing Variables Between 2 Movies
I need to pass a single variable from one flash movie to another. they are both on seperate html pages. I have done this before using ASP and I know it can be done with most other backend languages too. The trouble is I am limited by the clients crap intranet.

I have html, flash and javascript at my disposal. Anyway it can be done?

Passing Info To Movies
hi all,
could anyone please please please tell me how to get this done?
i have a main movie interface which loads other movies into it using the load movie-target action. now, what i would like to know is how do i pass variables to the loaded movie and then pass info back to the main movie from the loaded movie. is this even possible? i'm losing too much hair figuring out what to do.
so, pls let me know. i would be eternally grateful.
thanks in advance.

Passing Variables Between Movies
hello fellow flashers,

In need of your wisdom, yet again.

I want to declare a variable which can be accessed in another movie. I have a movie loading in an MC. In that movie there is a link to another movie, which has several sections. I want to target a specific section. This is what I have on the link in the first movie:

on (press) {
_global.section = "sales";
gotoAndStop(27);
loadMovie("investor.swf", _root.dropmenu);
}

Then in the investor.swf (the movie with all the different sections), I have in the frame action:

if (_global.section eq "sales") {
gotoAndPlay("sales");
}

Nothing happens.

I hope this is enough info.

Thanks in advance!!

Passing Info Between Movies
Ok I'm not entirely sure how to do this, hence posting this.

But basically I have a a main movie which uses buttons to load several other movies.

What I want to do is get some text in the movie that is being loaded and pass it back to main movie.

I guess I will need a dynamic text box in the main movie but I'm not sure the commmand / code to use.

Any help would be greatly appreciated

Variable Passing Between Movies
Hi,

I want to send a varibale from the current movie to the new movie that I am loading, with the Load movie command. It is not a web based, so using Get or Post methods have not been successful.

Please email me at khushru_kanga@hotmail.com if u have know how.

Thanking you,
Khushru

Passing Variables Between Movies
Hi

I have one EXE Flash file and one SWF file... I call the second one from the first one... I'd like to pass variables from the first to the second without using text files... how is that possible? I hope that's clear!

nico

Passing Variables Down Through Movies
So, I'm creating an interactive test.

9 categories, 15 yes/no questions in each category, with total scores (yes's) for each category grouped together (in a separate movie) at the end of the test.

I've made it so that for each category, the number of yes's the user clicks gets totaled in something called "categorytotal"

To limit the stress of download, I've created separate swf files for each category (each question is accompanied by a vocal soundbite, which takes up a lot of room if put into only one file). Somehow, I have to get the "categorytotal" from each separate movie to move on to the final movie in which all totals shall appear.

Basically, the user has to see all of their totals gathered at the end, and somehow, their entries (variables) have to be passed along.

How would I do this?

I'm using LoadMovie to load in each successive swf/category of the test. In the Variables box, I've tried out POST, hoping that this would somehow pass on the new total for a variable such as "musictotal", so that it could eventually be passed on down to the last movie. Do I need to use LoadVariable, too?

Can this even be done???

Any help is greatly appreciated!

Thanks,
Shak

Passing Variables Between Movies
Is using globals the best way of passing variables from an already loaded movie to a new movie being loaded, or is there a better way? If so, what is it? Tks

Passing Actionscript To Different Movies
I have a page split in to frames. Header frame which contains the navigation swf. Then a left bar which will holds the other flash movie and the mainframe which will hold the html content.

In my navigation I have 6 buttons. In my movie I have 6 different sections corresponding to the buttons. So what I want to do is when a button is clicked it will play the animation in the swf in the left frame and display the html. When another button is clicked I want it to play out the timeframe and then jump to the section in the timeframe that corresponds to the navigation and also display the html content in the mainframe. I was told to use _telltarget? Can someone help me out please.


Thanks

Passing Variables Between Movies
Hi,

I'm loading movie2 into movie1 and want movie2 to use a variable I have set in movie1. I thought it would be recognised as a global variable but it doesn't seem to work.

anyone any ideas?

cheers!
Tammy

Passing Variables Between Movies
Hi
How can i pass variables between movies like:
nome="Tavares";
Cod_Delegacao="Coimbra";
If i do
loadMovieNum("despesas.swf?Nomes="+Nome+"?Cod_Dele gacao="+Delegacao,1);
don't work (for the variable Cod_Delegacao). How can i do that?
Thanks
Mario

Passing Variables Between 2 Movies
Hi,

I have 2 separate flash movies on one html page. Effectively there is a menu movie and a display movie. I would like the display movie to react (on mouseover) of the individual menu components.

I have done a fair amount of research on this so far and can not find a simple solution. Perhaps it is too simple and is staring me in the face. Surely there is a way to pass variables from one flash movie to another?

Your help is VERY much appreciated,
Best regards,
Tony

Passing Variables Between 2 Movies
Okay, this question is fairly simple, but for the life of me I can't figure it out. I'm feeling rather dumb, but it's been a while since I've tried this.

I have two movies on the same page and I need to pass variables between them without having to reload the page. How do I do that?

Thanks!

Passing Variables Between Movies
ok, I have five swfs in different pages but on the same site. One of them is the main swf that is always open (the other four are beeing opened and closed all the time). What I need is to know how to make the 5 swfs be exchanging variables all the time, in my last try I could only make them oad the variables once, then they wuldnt change again.

Passing Information Between Movies
I have found many posts about passing information between movies on this very informative board, but none that directly relate to my problem.

I have a shell movie that uses loadMovieNum("secondmovie.swf", 1) to load another movie. What I am trying to do is stop my shell movie's timeline until the other movie is loaded (using a preloader), then have the shell start playing again. Any suggestions on the correct code to use?

[mx]passing Variables Between Movies
Hi!!

I want to know how I can pass parameters between 2 swf files..

Can anyone help me??

Passing Data Between .swf Movies.
http://vhektor.com/myoctopus/

Go to 'More Info' and click "Try It" (The leftmost option)

A map of the US comes up and users will select where they work, before getting to the next page, which is a form where they fill out the rest of their contact information. The Submit button sends the form variables to a php file on a different server which then stores their info in a database and will take the "location" variable from the map (in the previous .swf) to send the user the correct demo map.

My vars from the form post to the PHP and a confirmation e-mail is sent to the user etc. etc. this works fine...i'm just confused as to how to send the location variable that was pre-selected to send along with the form.

Thanks!

[mx]passing Variables Between Movies
Hi!!

I want to know how I can pass parameters between 2 swf files..

Can anyone help me??

Passing Parameters Between Movies
I've got a movie with a load of parameters passed into it (using FlashVars).

It replaces itself with another movie, using the "loadMovie" command:

CODEloadMovie("../movie2/movie2.swf", this);

Passing Variables Between Movies
I have two .swf flash movie files. I plan to  distribute these movie files  on a CDROM. I want to know how I can pass dynamic variables between these two movies

Passing Variables Between Movies
I have a login movie on a pre-homepage, after you've logged in via a database it opens the home page. Is there any way to pass the variables from login to a new movie on the home page?

I could use the database again, but this might present a problem if there are multiple users. What exactly does getURL pass when you use the post variables argument? Could you make the home page an asp, then send variables from the login movie using getURL with homepage.asp and then somehow get at those with a movie on homepage.asp?

Passing Variables Between Movies.
I have a button in one movie with the following script on it:

on (press) {
loadMovieNum("raygun_2.swf", 0);
_global.firstAction = "with (_level0.ScrollBarAbout.scroll) {_y = 14;}";
}
on (release) {
unloadMovieNum(0);
}


It needs to unload itself and send the variable "firstAction" which contains the command :
with (_level0.ScrollBarAbout.scroll)
{_y = 14;
}

to the newly loaded movie "raygun_2.swf" which then needs to execute the "with" action to take the user to an "anchor point" within a text box.

I have tested the "trace" action and it seems to be sending the variable but I can not get it to execute the "with" action contained in the variable.
How do I tell the newly loaded "raygun_2.swf" to execute the action contained in the variable???

Passing Variables Between 2 Movies
I have two movies. I load one of them in the main movie. The secondary movie has a button who has to change the text in a dinamic text box, something like this:

on(release){
_root.form.data1.text="mytext";
}

Where form is a movieclip in the main movie and data1 is the dinamic tex box.

This is what i´m doing but doesn´t work, can you help me?

Slow Movies By Passing A Parameter
If i have an movieclip embedded in a webpage, is it possible to control the frame speed of the movieclip via a parameter passed from a form on that webpage?

Any comments appreciated

Passing Variables Between Flash Movies
Okay, after trying to sort through the hodge-podge of "tutorials" online, I stil can't find an easy way to pass variables between two different flash movies. Is there an easy way to do this without using PHP or ASP or anything like that?

Passing Vairables Between Movies On Different Frames
Is it possible to pass values between variables of two different movies working on two different frames.

Passing Variables To Loading Movies
using loadMovie or MovieClipLoader, how would i pass a parameter to the movie being loaded ?

the reason for this is that i'd like to have images dynamically and externally loaded

thanks

Passing Variables Between Two Flash Movies.
Problem:
I have 2 flash movies in seperate frames and I want to be able to pass a string variable from one movie to the other? Any suggestion would be greatly appreciated. Thanks

Passing Variables Between Two Flash Movies
I have three flash movies.  Systems.swf, productDetails.swf, placeorder.swf

The first one (systems.swf) loads variables from an ASP page and loads nine records into the movie and displays everything I wan beautifully.  for each record there is a button on the movie that says "more info"  this button calls the second movie (productDetails.swf) it uses     

loadMovieNum ("proddetails.swf", 0, "GET");

this page calls an ASP to get more details from the table on the selected system.  It succesfully passes variables about the selected system to the second movie which in turn, passes it to the second ASP page and displays the the details of the system. On this move there is a button, to purchase the item.  It uses the same

loadMovieNum ("placeorder.swf", 0, "GET");

to call the third movie. this is where the problem happens.  the second movie doenst work.  The screen goes blank, through troubleshooting Ive figured out that it doesnt get to the first frame of the third movie. its as if passing the variables the second time seems to kill the movie and it sits dead in the water.

Im using Flash 5 if it makes a difference.  If anyone has any idea of whats going on please let me know.

Passing Variables Between Loaded Movies With Both Of Them On Level0
I have two movies, moviepart1 and moviepart2. when moviepart1 gets done playing and the user clicks on the "next" button it loads moviepart2 onto level0. I need to be able to have a back button on the first scene of moviepart2 to take the user to the last scene of moviepart1. Here is the actionscripting I am using:

This is on the back button on moviepart2:

Code:
on (release) {
jump=1;
loadMovieNum ("moviepart1.swf", 0, "GET");
}
and I have a wait scene at the beginning of moviepart1 to use a conditional to figure out if that variable has been sent or not. hereis that conditional:

Code:
if (_level0.jump == 1) {
gotoAndPlay ("scene3", 1);
} else {
gotoAndPlay ("scene1", 1);
}
I hope that this is enough information to get some help and I would greatly appreciate any help.

Thanks,
Justin
[Edited by therealsyko on 12-18-2001 at 11:20 AM]

Passing Variables From Dynamically Loaded Movies
Why can't Flash pass data from a dynamically loaded movie to the root timeline?

Here's the code in Frame 1:

_root.loc = "ABC";

//the Left Key traces the variable that is modified by the dynamic movieclip

userKey = new Object();
userKey.onKeyDown = function(){
if(Key.getCode() == Key.LEFT){
trace(_root.loc);
}
}
Key.addListener(userKey);

//the button dups the movieclip and loads a movie into it

_root.counter = 0;

bt1.onRelease = function() {
duplicateMovieClip(mct, "mct"+_root.counter, _root.counter);
loadMovie(counter+".swf", "mct"+_root.counter);
_root.counter ++;
};

Here's the code in the base movieclip (mct), that is duplicated in all sunsequent movieclips:

on(press){
nam = _name;
_root.loc = nam;
trace(nam)
trace(_root.loc);
startDrag(this);
}
on(release){
stopDrag();
}


Basically, I want to duplicate movieclips, load swfs into them, then identify which movieclip/swf has been clicked on, and pass its name to some scripts on the root timeline.

Note that if you comment out the loadMovie line - it works.

Thanks for your assistance.

Passing Variables And Values Across Multiple Movies
Hi,

I've got this code on a button in a clip called "topHeader.swf" within a parent movie called "mainMovie.swf"


Code:
on (release) {
_root.letsGo = true;
}

Now, I've got this code on this other clip called "bookingClip.swf" within the same parent movie.


Code:
if (_root.letsGo==true) {
gotoAndStop(1);
}

I'd love to know why it isn't working?

Any help would be greatly appreciated.

Blastbum

Passing Global Variables Between Seperate Movies
Is there a way to do it without flashvar/javascript?

I need ONE tiny variable passed from level0 to level1, but from what I've read so far, there's no other way.

Anyone?

Thanks!

Passing Variables From Loaded Movies To The Loader Movie
I am loading a swf file into an empty movie clip in the main Flash program (mainApp). I am trying to pass variables by value from the loaded movie to mainApp.

This function is in mainApp:

function read_1_vars(band,qual, lang){
trace("--------------------");
blnBandwidth=band;
blnQuality=qual;
language=lang;
}


This is the code used in the loaded movie to contact mainAPP:

_root.read_1_vars(blnBandwidth, blnQuality, language);


All this code worked just fine when contained in one one single file.

Any ideas? What am I missing? Thanks.

Avoid Reloading Of Flash Movies When Passing Them Variables From Html
Hi all.
I've created a two-levels flash menu (mainsections each with subsections) which I am using as navigation in a html page. When I go to a different page, the html sends the movie a variable telling it to what section it should be automatically opened. Everything works fine except that when the movie receives a new variable it reloads from zero. Is there any way to avoid this without the use of frames?
Thank you very much.

Button With 2 Functions? Onrelease=true, Onrelease=false
I have a button that uses a function to set the visibility of an mc. BUT it's called with an 'onrelease' and I would like the button to change the visibilty back to false on the next onrelease. Understand?
Here's my code:

list_btn.onrelease = function() {
playlist._visible = true;
}

Now I want to press the same button and have the mc (playlist) go back to false. I tried using some 'if' statements but just couldn't seem to get it right. My brain is just not working today.
Need some help please!

Passing Property Values And Passing Them Back
Hi,

I am trying to pass property values from one function to another function, let it do it's work then pass it back to original function when called.

Example:


Code:
function displayText()
{
nameCurrentMap.curMapName.text = flashServ.map;
nameCurrentMap.curMapName.embedFonts = true;
nameCurrentMap.curMapName._alpha = 0;
fadeInCurrentMap = setInterval(fadeIn, 50);
}

function fadeIn()
{
if(nameCurrentMap.curMapName._alpha < 100){
nameCurrentMap.curMapName._alpha += 5;
}else{
clearInterval(fadeIn);
}
}
As of right now this code works perfectly. However, I have to hard code my property value. I wish to make it more dynamic so I can use the function "fadIn()" more universally.

The colored (red) text shows on what I wish to make it more dynamic.

I basically want to take the property and be able to use any instance name in place and pass it back.

I hope someone out there understands on what I am trying to explain.

Any Help would be appreciated.

Thanks in advance,

- Alex

Loading Movies Inside Other Movies In An Ext Movie Holder?
Here's one for you:

I've got my main movie that has a movie holder on it (entitled movieholder.) The buttons on the left control what goes in the movie holder. In one of the movies there is a list of songs that are actually buttons. These buttons call up another movie(with MP3s). How do I get the MP3 movies to go into "movieholder" when they are being called by a button inside 'movieholder'

I'm using MX

Hope that made a slight bit of sense!

Thanks for any help,

Graeme

Trouble Creating Reverse Rollover Movies Within Movies
Hey ooh my first post.

I have been having trouble creating a movie clip with a reverse rollover effect within a movie which has a reverse rollover effect. that sounds confusing

In essence I wish to create a panel that rolls out on rollover and rolls back in reverse when the you rollout. I have done this using this script

stop();
this.onEnterFrame = function() {
if (rewind == true) {
prevFrame();
}
};
this.onRollOver = function() {
rewind = false;
play();
};
this.onRollOut = function() {
rewind = true;
};


However I wish to make movies within this movie that have the same effect on them. But when I create another movie or button within this movie it is not registering on rollover. I guess because the script on the main movie overrides it?


Sorry for the poor explantion, any ideas?

Movies In Movies And Multiple Scenes...grrrr HELP
Hi all!

loadMovieNum ("events.swf", 8);
level8.gotoAndPlay("DIRECT3");
stop ();

ok, i have just done a few flash movies, but I am openning swf files in my movie, however these movie have a preloader and a 2nd scene before the main scene.

The problem I have is that I need play from a frame in my main scene (called Direct3).

I used the above AS to load my movie, but I have a feeling that its not going to my requested frame label...

I am sure this is possible, please could someone point me in the right direction...

Thanx in Advance....

WolfFang

Loading Movies Into Movies With Scroll Bars O_O
I have a site where I'm showcasing my talents (Obviously figuring scripting out won't be one of them) and I load movies into the central area by using simple commands, and it all works. Now I need to have of of those movie to scroll around, because I'm showcasing banners and have more than 400 pixels of height can fit.

I was thinking of using the same textField system that I used for my news section, but replacibng the textField part was a different thing for Movies.

There's got to be an easier way though. Can anyone help me?

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