SunQuest
           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 1st, 2003, 01:03 PM
banzai_uk banzai_uk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 12 banzai_uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old September 4th, 2003, 11:23 AM
mushie mushie is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 58 mushie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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.

Reply With Quote
  #3  
Old September 5th, 2003, 09:50 AM
banzai_uk banzai_uk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 12 banzai_uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old September 5th, 2003, 12:53 PM
mushie mushie is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 58 mushie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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.

Reply With Quote
  #5  
Old September 5th, 2003, 01:12 PM
banzai_uk banzai_uk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 12 banzai_uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Please help! Loading variables into a nested movie!


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 6 hosted by Hostway