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 August 29th, 2003, 03:19 AM
scooterbabe scooterbabe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 8 scooterbabe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Setting dynamic text field in buttons?

Ok, I'm a newb

And I have a problem: I want to make completely dynamical buttons in which I want to set the text field.

I have a pretty plain movie in which I have created a button which only has an UP-state. In this button is a dynamic text field, which has the instance name dynText.

What I want to do is to drag, say like 10, instances of the button on to the stage and give them unique instance names. For ex button1, button2.... button10.

Then I would like to be able to change the text on each button individible...

Please, help - anybody???

Reply With Quote
  #2  
Old August 29th, 2003, 08:28 AM
Cyanide Cyanide is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 17 Cyanide User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 17 sec
Reputation Power: 0
First drag your button instances onto the stage, then name them all differently.

In the first frame of the main timeline put this code to set the text for your buttons.

_root.button1.dynText.text = "this is the text for button 1"

Reply With Quote
  #3  
Old August 29th, 2003, 09:00 AM
scooterbabe scooterbabe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 8 scooterbabe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by Cyanide
First drag your button instances onto the stage, then name them all differently.

In the first frame of the main timeline put this code to set the text for your buttons.

_root.button1.dynText.text = "this is the text for button 1"


This is exactly what I've been trying to do for the latest 2 days, but havent succeded to get it working...

Please check the file at http://www.miceandbrains.dk/victor/Untitled-2.fla

sincerely

Victor

Reply With Quote
  #4  
Old August 29th, 2003, 09:40 AM
Cyanide Cyanide is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 17 Cyanide User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 17 sec
Reputation Power: 0
Oops, forgot about that...

You'll have to use movieClips instead of buttons. If you're using flash5 you'll have to us a hitTest to check if the mouse position is over the clip when it's clicked. If you're using MX just use the onRelease event.

Reply With Quote
  #5  
Old August 29th, 2003, 09:44 AM
scooterbabe scooterbabe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 8 scooterbabe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by Cyanide
Oops, forgot about that...

You'll have to use movieClips instead of buttons. If you're using flash5 you'll have to us a hitTest to check if the mouse position is over the clip when it's clicked. If you're using MX just use the onRelease event.


Using MX - how to use movie clips as buttons?

Reply With Quote
  #6  
Old August 29th, 2003, 03:32 PM
Cyanide Cyanide is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 17 Cyanide User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 17 sec
Reputation Power: 0
In MX MovieClips have the same events that buttons do. There's really no need for buttons in MX.

Example: (this would go in a timeline frame, not the clips actions)

Code:
myClip.onRelease = function(){
    trace("you pressed " + this._name);
}

Reply With Quote
  #7  
Old August 30th, 2003, 10:17 AM
scooterbabe scooterbabe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 8 scooterbabe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by Cyanide
In MX MovieClips have the same events that buttons do. There's really no need for buttons in MX.

Example: (this would go in a timeline frame, not the clips actions)

Code:
myClip.onRelease = function(){
    trace("you pressed " + this._name);
}


Could you please explain that code..?

Reply With Quote
  #8  
Old August 31st, 2003, 02:35 PM
scooterbabe scooterbabe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 8 scooterbabe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok, I managed to get it to work with MC's instead of buttons, but I have encountered a new problem...

After I've set the dymaic text fields I use a gotoAndStop to go to another frame in the movie. But in this frame, the text fields have "forgotten" their values...

Is there any way of getting round this, or do I simply have to reset all text fields when I get to another frame?

Best regards,

Victor - a little less Newb now but anyway

Reply With Quote
  #9  
Old October 14th, 2003, 09:43 PM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
Hi Victor,

I'm sorry that no one responded to your last reply. Keeping variables intact is quite easy. It just requires that you work in layers and that the last keyframe of the variables' layer is cleared. I've included an FLA to demonstrate.

Sincerely,
Jamie Michels www.thedarkcontent.com
Attached Files
File Type: zip untitled-2.zip (3.8 KB, 334 views)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Setting dynamic text field in buttons?


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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