Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 8th, 2003, 10:22 AM
INE-Kpro... INE-Kpro... is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Australia
Posts: 113 INE-Kpro... User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 38 m 7 sec
Reputation Power: 5
control movies and buttons in different levels

hello all:

here is the scenerio:

I have levels of movies

Level 1 ---> contents of TV.swf
Level 0 ---> TV.swf


Level 0 is my television looking movie, it has the controls to select the channels
Level 1 is the contents of what goes inside the television on level 0

So when u select a channel on the TV.swf, it will load the contents of TV.swf.

What I would like to do is the following: can you please answer it in context with what I would like to do, than just typing me some code or script because i am a newbie so I need to see how the script fits and relates into the
whole picture. eg: dont just type
_root.xxxx () play.nextto
can you please answer it like:
select your button, go to actions, choose (with) then insert this code.
or something like that. Will be greatful if u can.

1) I would like a button i have installed in "contents of TV.swf" to be able to control "TV.swf" or level 0. like a button in "contents of TV.swf" will turn level 0 or replace the "TV.swf" with a "radio.swf", or maybe the button in "contents of TV.swf" will tell the "TV.swf" to play the "led display.swf" thats inside it. The "led display.swf" could be like a bargraph movie which is part of or inside the "TV.swf"

I hope that makes sense, even I lose myself in my own writing ; )

2) here is another problem i have encountered.
How do I control the movie inside a button?
with the with action, it doesnt seem to pick it up.

here is the scenerio
I have 2 buttons
I name them
button 1
button 2

button 2 has a spinning light playing in the up position. We shall call this spinning light, "spinning light"
I would like button1 when rollover or pressed to make the movie in button 2 to stop spinning the "spinning light"

The scenerio coule be that they are on the same level, like the root level, or button 1 could be inside a movie.
lets say



root level has movie A, inside it is button1

root level also has movie B, inside it is movie C and inside movie c is button 2 with the spinning light spinning

how do i make that spinning light stop while i am on rollover with button1


Now I know there are other ways of getting aroung this problem by changing the whole layout of it. But I would like to know the answer to this so that I can use the principle of it to other things i would like done.

3) is there a way or script for the movie in level 1, to make buttons on level 0 not active, and only active when "contents of tv" is removed.

I have made movies on top of movies in different levels before and everytime i rollover a certain area in the movie in level 1, it would make the button in level 0 work. How do I stop this


4) how do i make a button not active, so that I can use it when I have a rollover dropdown menu that happens to overlap the button. So when the dropdown menu drops down. I dont want the button to be active, only the menu so that the user can select, and click on it, without it accidently clicking the button beneath it.


Thanx to whoever helps me : )
__________________
INE-Kpro...
(eye-yen-kay pro)
http://www.INE-Kpro.com
enquiries@INE-Kpro.com
<--- watch this space --->

Reply With Quote
  #2  
Old September 8th, 2003, 11:59 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
hello,

you can reference variables on different levels by referencinf th elevel first

_level1.button
_level0.movieclip

and you can disable buttons (And movieclips with onX events) by saying

button.enabled = false;

this will completely disable it's hit state and frames. (where "button" is the instance name)

combining the two of those, you can easily disable buttons when you need to and enable them also.

-bret

Reply With Quote
  #3  
Old September 8th, 2003, 04:13 PM
INE-Kpro... INE-Kpro... is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Australia
Posts: 113 INE-Kpro... User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 38 m 7 sec
Reputation Power: 5
thanx brett for the quick response : )

now is that using the tell target (with) action. I place that in my object section
so basically i can use it like

_level0.root.movieA.movieB
play

or I do not have to put the _root in, since it will look at the level0 as reference to root?

2) now will the button remain disabled till I tell it to reactivate?

is this how I write it to enable the button
button.enabled = true;

Now how do I do that for example. I place the action in a frame. Now what action am i looking at here. onX, where do I find that action.
With that action, I can tell a spinning light to stop. will that stop on the frame its on, or will it go back to the start of the first frame of that spinning light and stop there.

Now by disabling a movie, does that mean it disables everything in the movie. So that means button as well. So if I wanted to disable a button inside a movie. All I have to do is disable the movie that the button is in? Is that right?

how would i write this button disable code. if the button is in a different movie?
so do I go to the tell target (with) action and combine it with that onX action.


3) in advance mode. I look at the code on the action window, and is confused at how the code is written.

gotoAndStop ( play ) :
nextFrame ( movie A )

I just made that up, I know it doesnt work. Now I dont get the damn spacing. Even with dreamweaver, the code looks like its on an escalator. The side gap gets bigger on the left side. It looks like its tabbed or more than the required spacing. How does this side spacing work. If I write my own code in advance mode, it looks like its going on forever on one line. I t doesnt go to the next line. Do I press return on certain parts. I try to write my own code, but it doesnt seem to work when i play it.


TIA

Reply With Quote
  #4  
Old September 9th, 2003, 03:09 PM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
Tia,

Quote:
Originally posted by INE-Kpro...
thanx brett for the quick response : )

now is that using the tell target (with) action. I place that in my object section
so basically i can use it like

_level0.root.movieA.movieB
play

or I do not have to put the _root in, since it will look at the level0 as reference to root?


You only need to reference the _level, you are correct in assuming that it references that level's _root

Quote:
2) now will the button remain disabled till I tell it to reactivate?

is this how I write it to enable the button
button.enabled = true;
That's correct

Quote:
Now how do I do that for example. I place the action in a frame. Now what action am i looking at here. onX, where do I find that action.
With that action, I can tell a spinning light to stop. will that stop on the frame its on, or will it go back to the start of the first frame of that spinning light and stop there.

You could put the following actions on a frame:

Code:
mybutton.enabled = false;
mybutton2.enabled = true;
spinning.stop();


And as long as your spinning moveiclip didn't leave the timeline (not present in another keyframe where the playhead is or something). then if you told spinning to play, it would start off from where you left off. Every time you went back to this frame, mybutton would be disabled, mybutton2 would be enabled and spinning would stop.

Quote:
Now by disabling a movie, does that mean it disables everything in the movie. So that means button as well. So if I wanted to disable a button inside a movie. All I have to do is disable the movie that the button is in? Is that right?

how would i write this button disable code. if the button is in a different movie?
so do I go to the tell target (with) action and combine it with that onX action.

you can disable MovieClips, not the whole movie (That i know of)... So, any movie that has onRelease or onRollOver or any other common button effects can be disabled. it works the same as disabling a button - you can't click, rollOver or release it (At least flash won't recognise that you did). Remember that you can't enable or disable anything that doesn't have an instance name. But once you have that instance name, as long as you get the path to it correct, you can enable or disable it from anywhere in your movie (even from different levels).


Quote:
3) in advance mode. I look at the code on the action window, and is confused at how the code is written.

gotoAndStop ( play ) :
nextFrame ( movie A )

I just made that up, I know it doesnt work. Now I dont get the damn spacing. Even with dreamweaver, the code looks like its on an escalator. The side gap gets bigger on the left side. It looks like its tabbed or more than the required spacing. How does this side spacing work. If I write my own code in advance mode, it looks like its going on forever on one line. I t doesnt go to the next line. Do I press return on certain parts. I try to write my own code, but it doesnt seem to work when i play it.


IF you write your own code (and even if you don't) statements that should be executed as one commaned need to be all on one line. Even if it scrolls over a lot, it won't play right (and even throw an error in the output window) if they are not on one line.

One thing you might do is go into your preferences and set your tab amount, so that it is less, if you don't want such a large gap

-bret

Reply With Quote
  #5  
Old September 9th, 2003, 04:04 PM
INE-Kpro... INE-Kpro... is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Australia
Posts: 113 INE-Kpro... User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 38 m 7 sec
Reputation Power: 5
again excellent response times Brett : )

now I see that when you say code, you are talking about typing it in actions using advance mode.
Can this be replicated using the basic mode, where you click onto the little menu on the left.

2) in regards to spacing, so everytime I write something thats a new command, I should press return. This new command, is that an independent new command, or part of a bigger command.

eg.

onPress; _root.movieA ;
play

or

onPress;_root.movieA ; play


I know this isnt right, but its just to get an idea. I looked at play as a command.

also I have a query about my other post in regards disabling sound, if you can look at that please

TIA

Reply With Quote
  #6  
Old September 9th, 2003, 04:27 PM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
yes, basically if you end a line with anything but a semi-colon or an open curly bracket, you're going to get an error. i would suggest moving to "expert" mode, as you are really limited with what normal mode will let you do...

something = somethig;

will work

something =
something;

won't work

onRelease = function(){
trace("released");
}

will work

onRelease
= function(){

won't work... the more you do it, the easier it gets to understand

-bret

Reply With Quote
  #7  
Old September 9th, 2003, 04:49 PM
INE-Kpro... INE-Kpro... is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Australia
Posts: 113 INE-Kpro... User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 38 m 7 sec
Reputation Power: 5
Ok, now with this code you mentioned


onRelease = function(){
trace("released");
}


did you press return on the {
why?

Is that the principle on how you do it.
Thats the part I don't understand
see how it's on the next line.
Is there a tutorial on the way thats written

onRelease = function(){ trace("released");
}

you placed a space on the trace before and then return.

I think I will read up more on this, do you think that the best way is to use advance mode. Is there a page I can go to that you can recommend?



TIA
TIA

Reply With Quote
  #8  
Old September 9th, 2003, 05:48 PM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
hmmm.. i don't really know of any good websites dictating the syntax structure of actionscript... here's a small example of all the same types of code, looking different, but functioning the same:

Code:
var bret = "dork";
if(bret == "dork") {
	trace("bret is a dork");
} else {
	if(bret == "not a dork"){ trace("bret is not a dork");}
}
function setBret()
{
	trace("i'm in a function");	
}
function setBret2(){
	trace("i'm also in a function");
}
foo = ["i'm the first element of an array",
	   	"i'm the second",
		"i'm the third",
		"i'm the fourth"]
bar = ["i'm the first","i'm the second","i'm the third","i'm the fourth"];

So, notice, my if() statement can have the curly brackets on a new line or on the same line

my function can have the curley brackets on the same line or the next line. Basically, flash ignores white space SOMETIMES. how's that for confusing

it just depends on the type of thing that you are creating with actionscript.

you could even go hogwild and format it like

Code:
var 
bret 
= 
"dork"
;
if
(
bret 
== 
"dork"
)
{
trace
(
"bret is a dork"
)
;
}


and it will work. weird huh.. not very readible. Basically, it comes down to, if flash doesn't throw an error, code however you see fit (but there are some visual standards[tabbing, linespacing...] that stay pretty constant for all programming and scripting languages...

I would pick up the ActionScript definitive guide (second edition), and although it's rather technical, it is very detailed in teaching all of the coding principles and practices of ActionScript.

maybe to a websearch on ActionScript formatting or something. When you are in expert mode, and hit "autoformat", flash will format your code (if there are no errors) to the most widely accepted format... i guess i don't have a "why" but rather, it's just how i learned

-bret

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > control movies and buttons in different levels


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway