Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-12-2007, 09:07 AM   #1
gratnells
Registered User
 
Join Date: Dec 2006
Posts: 109
Default changing var in main MC from externally loaded .swf?

Hi,

Is there a way that I can change a boolean variable from an AS frame on a MC that has been loaded into my main movie?

I have my var declared in my main movie. When the timeline in my externally loaded .swf gets to the end of its animation it needs to change the var.

This doesn't seem to work so I guess vars only work in their own movie.

This is my var on a frame in a mc in my main movie...

PHP Code:
var panelPressed:Boolean = new Boolean(true); 
How can I do this?

Thanks.
gratnells is offline   Reply With Quote
Old 06-12-2007, 09:16 AM   #2
Paul Ferrie
Scottish and mad fer it!!
 
Paul Ferrie's Avatar
 
Join Date: Jun 2002
Location: uk/scotland/glasgow
Posts: 3,606
Default

How is the movie being loaded into the main swf?
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- InnovativeDesigns - Scotflash - About me
Paul Ferrie is offline   Reply With Quote
Old 06-12-2007, 09:21 AM   #3
gratnells
Registered User
 
Join Date: Dec 2006
Posts: 109
Default

Thanks for replying... but, I've solved it myself

I love it when that happens.

Just needed to do this...

PHP Code:
_parent._parent._parent.panelPressed true
on the loaded .swf frame.

Thought I read somewhere that you couldn't change Vars outside their scope (not sure if that's the right term!
gratnells is offline   Reply With Quote
Old 06-12-2007, 09:25 AM   #4
Paul Ferrie
Scottish and mad fer it!!
 
Paul Ferrie's Avatar
 
Join Date: Jun 2002
Location: uk/scotland/glasgow
Posts: 3,606
Default

Variables declared within functions cant be changed from out with the function(i think)
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- InnovativeDesigns - Scotflash - About me
Paul Ferrie is offline   Reply With Quote
Old 06-12-2007, 09:43 AM   #5
gratnells
Registered User
 
Join Date: Dec 2006
Posts: 109
Default

Ohh, i see.

thanks
gratnells is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with "_Alpha" tween code below... daveg_92656 ActionScript 2.0 0 04-23-2007 12:49 AM
Problem with a for...in loop in a for...in loop VictoriaWelby ActionScript 2.0 2 04-09-2007 11:20 PM
Changing Size Of .swf Loaded into main movie Balus ActionScript 2.0 0 01-02-2005 07:43 PM
Textfield scrolling in loaded .swf not working squidz ActionScript 1.0 (and below) 2 12-31-2004 01:56 PM
sending variable from main movie to a loaded movie sheldonserrao ActionScript 1.0 (and below) 2 06-06-2001 05:57 AM


All times are GMT. The time now is 10:34 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.