Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-03-2005, 07:03 PM   #1
jimmydwilson
Registered User
 
Join Date: Jul 2005
Posts: 10
Default conditional statements from movie loaded in scrollPane?

Hello everyone,

I'm having a problem with an external .swf that I have loaded into a scrollpane. I have buttons within this external .swf that affect the main timeline using the _level0 function. Though I make simple actions affect the main timeline (ie gotoAndPlay), any conditional statements that I make don't seem to register on the main timeline. Does anyone have any idea why this is and how you can make conditional statements apply to the main timeline from inside a scrollPane?

Here is the script that I have on one of the buttons:

ActionScript Code:
newsbut1.onRelease = function() {     _level0.gotoAndPlay (307);     _level0.news = true     _level0.contact = false     _level0.who = false     _level0.what = false     _level0.studies = false     _level0.our = false     _level0.COR = false     _level0.newsmain = false     _level0.news1 = true     _level0.news2 = false     _level0.news3 = false     _level0.news4 = false     _level0.news5 = false     _level0.news6 = false     _level0.news7 = false     _level0.news8 = false     _level0.news9 = false     _level0.news10 = false }

The gotoAndPlay part works, but the rest doesn't (based on testing with the trace function). Any ideas? Thanks in advance, and just so you know, I'm pretty beginner-ish, so complex solutions will definitely go over my head.
jimmydwilson is offline   Reply With Quote
Old 08-03-2005, 07:36 PM   #2
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

Are all those variables located on the _root timeline, or the loaded movie?
__________________
Color Wars | (kul′ər wrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Old 08-03-2005, 07:48 PM   #3
jimmydwilson
Registered User
 
Join Date: Jul 2005
Posts: 10
Default

Hi Cota, thanks for the quick reply

All of those variables are meant to affect behaviour in the main timeline (ie i want the if (x==true) and corresponding action to take place in the main timeline. hope that clears things up.
jimmydwilson is offline   Reply With Quote
Old 08-03-2005, 08:11 PM   #4
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

well it may be pathing issue...._level0 refers to the _root timeline. So if they exist in a movieclip, they would require that path. The other options is to make them _global variables. Just replace _level0 with _global
__________________
Color Wars | (kul′ər wrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Old 08-03-2005, 08:41 PM   #5
jimmydwilson
Registered User
 
Join Date: Jul 2005
Posts: 10
Default

Hi Cota,

I don't think that _level0 vs. _root is the problem, because as I said, the gotoandPlay function works properly and it is set to _level0. I don't think that _root would work because the buttons are in a separate swf on another level. anyways, I will give making them global variables a try. Thanks a lot.
jimmydwilson is offline   Reply With Quote
Old 08-03-2005, 09:16 PM   #6
jimmydwilson
Registered User
 
Join Date: Jul 2005
Posts: 10
Default

Ok,

here's an update, I've tried changing all the _level0 functions to _global functions (on the send and receive ends of the conditional statements) but still no luck. Does anybody have any other suggestions? Thanks in advance.
jimmydwilson is offline   Reply With Quote
Old 08-03-2005, 10:03 PM   #7
jimmydwilson
Registered User
 
Join Date: Jul 2005
Posts: 10
Default

OK, finally figured it out after much frustration. The problem was that I had the gotoAndPlay command first and the conditional statements after. It moves to the other level before it has a chance to carry out the conditional statements. This isn't a problem if you have a goto command followed by conditional statements in the same movieclip, but if you do it between levels, it doesn't have time to recognize subsequent statements before executing the goto command. Hope this saves someone out there some time, because I've been wrestling with this all day.
jimmydwilson is offline   Reply With Quote
Old 08-04-2005, 01:04 AM   #8
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

sorry I missed that...
__________________
Color Wars | (kul′ər wrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota 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


All times are GMT. The time now is 12:41 AM.

///
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.