|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Please help! Loading variables into a nested movie!
ok, i'm no programmer but i'm trying to learn flash at the moment and am having problems with a dynamic button i've created. the button is a movie clip (instance name: list_item) with 2 frames. each frame has a dynamic text field named with variable "name". the only difference between the 2 text fileds is colour (frame 1 is black, frame 2 is red). this is setup to create a mouseover effect so that the text will change colour each time a button is hovered over. a button is created on a seperate layer that spans both frames with the following actions:
on (rollOver) { gotoAndStop(2); } on (rollOut, releaseOutside) { gotoAndStop (1); } this movie is then nested in the root movie if that makes any senese. the action in frame 1 loads an external text file as follows: loadVariablesNum("text.txt", 0); the text file contains the following: &list_item.name=This is my text button when i publish the movie it loads the variable into the nested movie at frame 1 but when mouseover event occurs the variable disappears when going to frame 2 of the nested movie. onrelease the text also fails to reappear. can someone please explain what's going on? i've been going nuts trying to solve this. |
|
#2
|
|||
|
|||
|
using flash MX??
not sure about the &list_item.name notation and its always simpler to store variables in the main timeline so you can reference them from anywhere without resorting to _parent._parent._parent etc! also the way you are going about it seems a bit kludgy to me - better to use a movie clip as a button and define the actions on the movieclip, setting variables that are loaded into the main timeline (_root) you can either change frames inside the clip to represent different states (like the way a button works) or apply a colour change to the properties of the text field. (uses frame change method, since i think the text field transform uses to much code for such a simple requirement) hope this helps
__________________
beware of geeks bearing animated gifs. Last edited by mushie : September 5th, 2003 at 02:26 PM. |
|
#3
|
|||
|
|||
|
thanks m8 but i seem unable to download it (access denied). in anycase the problem still remains when i try and insert the variables into the main timeline (_root).
u can download my script here. it has been built in flash 6 but for the life of me i can't figure out what the problem is. |
|
#4
|
|||
|
|||
|
download seems to work ok from here....if u send a mail to me with a response email i'll send it (this site doesnt show me your mail)
opened yours up, but theres too much going on in it - havent got time to go thru it i cant understand why you cant access the variables unless its the way you are referencing them - i see that you are using 'telltarget' which is deprecated, and a pain in the butt to use....use dot notation throughout - could be the problem. be careful using 'this' - if its done on the main timeline then you are effectively saying '_root.' just guessing, i'll try and have a look later - mail me re file Last edited by mushie : September 5th, 2003 at 02:25 PM. |
|
#5
|
|||
|
|||
|
thanks m8. my e-mail address is mail@banzaiuk.com
i've tried everything i can think of and i agree it does appear to be a referencing problem. the interesting thing is the variables are intially loaded but when a mouseover event occurs over the movieclip, instead of changing the variables text colour (occurs in frame 2 of the nested movie) it just disappears. more significantly the initial variable is lost when rollout event occurs (by default this should return to the text field in frame 1 of the nested movie from which the initial variable was loaded). in short as soon as any mouseover/rollout/etc event occurs the variables vanish. it's a bit hard to explain but is simpler when you're looking at the FLA. i would appreciate if u could have a look at it since i've been trying for weeks to get this to work. if u have any questions then please e-mail me. on a siednote the movie is essentially trying do the following: - generate a menu with submenus - the menu & submenu variables are displayed using just 1 text field. - the movie parses the variables to distinguish menu & submenu arrays & duplicates them according to their variable name. e.g. item0client="Menu Item 0"; item0name="Sub-menu 0"; item1client="Menu Item 1"; item1name="Sub-menu 1"; and so on... Last edited by banzai_uk : September 5th, 2003 at 01:21 PM. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Please help! Loading variables into a nested movie! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|