For your first question - you will not be able to access clip_mc unless
the playhead is on a frame where that movieclip exists. You should be
able to access the mc and all child mcs immediately after going to the
correct frame, however you will not be able to execute any script
defined inside the movieclip until a frame has passed.
With your second question, the scoping is not necessarily what you would
expect. The scoping of the function is wherever you define it, for
example having
blah = 1;
clip_mc.btn1_btn = 2;
clip_mc.btn1_btn.onRelease = function(){
trace( this );
trace( blah );
}
will trace
_level0.clip_mc.btn1_btn
1
when you click. Of course, you don't have to worry about the scope of
_root.variableName, as you are providing the absolute path to the variable.
Regards,
Grant Cox.
Jonathan Berry wrote:
I just had a thought on this. Perhaps I just need _root.variableName inside
the getURL since we are using a variable returned from FlashVars. Are
anonymous functions such as clip_mc.btn1_btn.onRelease = function(){}
subject to scoping issues?
On 4/17/06, Jonathan Berry <[EMAIL PROTECTED]> wrote:
Hello all, I know this is really basic, but I wanted to know something
about timeline code. Everything I have read about placing your code says you
should place it in a central location, so I set my code in the timeline
first frame, actions layer - as recommended. However, I am finding that
sometimes buttons do not react unless the onRelease event handler is in the
same frame as where the movie stops. Is this correct? Do actions have to be
in same frame as where the movie stops and you want the interactivity?
Though I wanted to get the answer to this general question, what I have
specifically is a movieclip with buttons inside of it. I have tried putting
the code for these buttons in the first frame of the main timeline or in the
last frame of the main timeline, where this movieclip is instantiated. But
neither method works.
I use something like this: clip_mc.btn1_btn.onRelease =
function(){getURL(etcetcetc.);};
Where should one place this code? Are actions present in the first frame
of the main timeline applicable to all subsequent frames, unless
overwritten? In case you wish to know, the buttons and movieclips do have
instance names.
Thanks in advance.
--
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
[EMAIL PROTECTED]
www.mindarc.com
-----------------------------------------------------------
This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged.
This information is confidential information and is intended only for
the use of the individual or entity named above. If the reader of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.
-----------------------------------------------------------
--
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
[EMAIL PROTECTED]
www.mindarc.com
-----------------------------------------------------------
This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged.
This information is confidential information and is intended only for
the use of the individual or entity named above. If the reader of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.
-----------------------------------------------------------
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com