Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Flash




Create/generate Dynamic Button



Hi, I've searched the posts but can't find any help...

I'm trying to create a button for items I generate via XML.
I need to draw a button area dynamically since the active area will be supplied from a database.

How do I do this? And how do I assign the button it's onMouseOver, onRelease commands?

I will have a number of these, so I will be generating them with loops etc, and their commands needs to reflect on their IDs...

I hope this makes sense haha
I have already done all the rest of the working application, just can't get the damn button going

Thanks in advance!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

How To Create Sliders? How To Generate Results Based On User's Answers?
im interested with this site (bauer.com/Content/Gear/stick_advisor.html or if you couldn't go directly to the site, you could type in bauer.com then locate GEAR, and then STICKS, then FIND YOUR STICK.) so, if you're willing to help me out you could check out this site to understand what i wanted to do.

this site sells hockey equipments and there's this portion of the site that help visitors find the stick that matches their character. Basically, there were 5 questions that you're gonna answer (you'll be using the slider in answering). now, this is my question. If i'm gonna make something like this, what should i do first? do i need a database for this? how am i going to generate the results based on the user's answers? and what if i put a scale from 0% to 100%?

thanks a lot to those of you who paid attention to this thread. tnx so much! youre such a big help. and uhmm.. sorry then if some or even all my questions seem stupid to you coz im just a newbie.

tnx!

Using XML To Create Dynamic Button
I'm new to Flash and Action Script but I'm attempting to build my first site using it. The site I'm building is for my daughter so that our family can stay up to date with her as she grows up (thought it would be a good project to learn flash).

Anyway, I'm using SimpleViewer as the flash gallery builder. However, by using this I have to split all the photos up into seperate galleries. What I want to do, is create a PHP script to generate an XML file that contains all the new galleries in a specified directory. Then have Flash read this XML file and create buttons that link to each respective directory.

I'm proficient in PHP, but how do I get Flash to read the XML file, then create dynamic buttons that link to each gallery?

I'm using Flash 8.

Trying To Create Dragable Button(mc) With Dynamic Text In It.
I am creating a "game" that the user can take a term and drag it over the correct definition, and then check their results. I am using a combination of these two tutorials "Drag 'n Drop and Drop Targets" and "Creating Flash 5 Quizzes". I am using Flash MX. The one thing with this is that the terms and definitions must be able to be pulled in from an outside source. Can dynamic text be used in this case? I need it to be dynamic so that the info can pull from a database but when I do use dynamic the button is always in the
"on (press)" state, same with the text I am trying to drag it on to. As long as the term and the definition is static text it works fine, as soon as one of them is changed to dynamic text I can't get the button to release correctly.

Please help.
Steph

How To Create Dynamic Button That Displays Database Text?
i'm trying to create dynamic buttons that can load news text from my database. basically, each button would represent a news post and pull it from the database. the algorithm i thought of is something like:

-count x posts in database
-duplicate x buttons for each post
(assign newsID from news database to button while creating it)
-when user clicks button, grab same newsID from database and write to text field

hope that makes sense :p

Create Dynamic Buttons, Dynamically Assign Button Text?
Hello Kirupa!

I'm trying to create buttons dynamically from xml data, only I want to use a real button, from my library, so that I can have up/over/down states for the button.

Basically I want to do this:

1. open xml loop
2. while looping, assign (attachMovie) an instance of a button from my library to a movie clip on the stage for each row in the xml data.
3. BUT, I also want to dynamically assign the button text from the xml data.

And that's were I'm stuck. Inside my button, I have a dynamic text box, and normally, I know how to change the text of a dynamic text box using actionscript, but I can't seem to change the value of the dynamic text box inside the button.

Is this possible?

Generate Dynamic Textboxes From XML
I need to dynamically create a number of dynamic textboxes based on the following:

1. each textbox is named after a specific nodename
2. its value is the attribute of that node

Basically I want to loop through an xml object and create a text box for each node, I presume it would work something like this:

//loop through nodes
for (i=0;i < recieveXML.firstChild.firstChild.childNodes.length ;i++)
{
// create dynamic tect box
//name after nodename
//assign node attribute as value
}

does anyone know how to achieve this?

Many thanks in advance!

Trying To Generate Dynamic OnRelease
Hi, I want to make a dynamic world map,
I have a stage where every country is a button symbol, name of the occurrence is the name of the country.
I have also an xml file, The xml file contains the name of the countries that I want to Highlight and comment.

So I extract the datas from the file, no problem, I make a loop "for (i=0;i<nb_item;i++)" to highlight the good countries, and then I want to attribute to each highlighted countries a "onrelease" property, where a little description of the country appears (trace function, for the moment).

But I can't deal with it, My active countries/button return something, but all the same, (the last value of the i var). So I can imagine that it is because actionscript evaluates the expression only when you "release the button", but I can't find any other solution.

Help wanted !!

Here is the code :


Code:
n_id = new Array()
n_pays = new Array()
n_detail = new Array()


function parseListe(success){
if (success == true) {
n_root = liste.firstChild;
nb_item = n_root.childNodes.length;
for (i=0;i<nb_item;i++){
n_current = n_root.childNodes[i];
n_id[i] = n_current.attributes.id;
n_pays[i] = n_current.attributes.pays;
n_description[i] = n_current.attributes.description;

macouleur = new Color(n_pays[i]);
macouleur.setRGB(0xFF6633);

var trans =eval (n_pays[i]) ;
compteur = i;
trans.onRelease = function () {

trace (n_pays[compteur]);
trace (n_detail[compteur]) ;
};

}
Anyone has got an idea, I'm lost !

Thank's

Silouman/France

Generate Dynamic Shape?
Hi,

I have created a movieClip through actionScript but now with to create a rectangular shape to it. I guess i could do it by drawing lines and then fill but is there an easier way?

Thanks

Generate Dynamic Shape?
Hi,

I have created a movieClip through actionScript but now with to create a rectangular shape to it. I guess i could do it by drawing lines and then fill but is there an easier way?

Thanks

Export Dynamic Generate Flash (swf) As Jpg
Hi people,

Something I wanna do but can’t figure out how to start.

Basically I have a small flash application that allow user to customize a avatar or something. After the customization, there should be a function that allow them to download the avatar they create as a .jpg file

I know this is possible, had seen something like that before, but how should I start about doing this?

Please advise…


Thanks

Dynamic Textbox To Generate Date
Hi and thank you! I have a dynamic textbox called date_txt. Trying to make it generate a date (just month, date adn year), that is 120 days prior to a current date. please help, as this code generates seconds, milliseconds, and time zone - which I don't need...Thank you so much!

var now:Date = new Date();
var nowInMilliseconds:Number = now.valueOf();
var MILLISECONDS_IN_DAY:Number = 86400000;
var timeMinus120days = nowInMilliseconds - MILLISECONDS_IN_DAY * 120;
var myDateMinus120days:Date = new Date(timeMinus120days);
var strDate:String = myDateMinus120days.toString();

date_Txt.text = strDate;

Dynamic Textbox To Generate Date
Hi and thank you! I have a dynamic textbox called date_txt. Trying to make it generate a date (just month, date adn year), that is 120 days prior to a current date. please help, as this code generates seconds, milliseconds, and time zone - which I don't need...Thank you so much!

var now:Date = new Date();
var nowInMilliseconds:Number = now.valueOf();
var MILLISECONDS_IN_DAY:Number = 86400000;
var timeMinus120days = nowInMilliseconds - MILLISECONDS_IN_DAY * 120;
var myDateMinus120days:Date = new Date(timeMinus120days);
var strDate:String = myDateMinus120days.toString();

date_txt.text = strDate;

Export Dynamic Generate Flash (swf) As Jpg
Hi people,

Something I wanna do but can’t figure out how to start.

Basically I have a small flash application that allow user to customize a avatar or something. After the customization, there should be a function that allow them to download the avatar they create as a .jpg file

I know this is possible, had seen something like that before, but how should I start about doing this?

Please advise…


Thanks

Generate Dynamic Playlist In Flash
hey guy's

how to generate dynamic playlist in flash. so that it plays the 5 videos randomly from database.

AS - Export Dynamic Generate Flash (swf) As Jpg
Hi people,

Something I wanna do but can’t figure out how to start.

Basically I have a small flash application that allow user to customize a avatar or something. After the customization, there should be a function that allow them to download the avatar they create as a .jpg file

I know this is possible, had seen something like that before, but how should I start about doing this?

Please advise…


Thanks

Random Generate In Dynamic Text Field
Hello! Does anyone know how to randomly generate something to display in a dynamic text field. So far I have named the dynamic text field and in the actionscript I have called it, nothing comes up. I have search several places and still have not been able to solve the problem. However before I called the text box I tested my code with the trace function and It display in the output box but not the dynamic text box. Please help.

Example
generateRandom = function() { /* Code I used to call the txt box does not wk.
display.text = Math.ceil(Math.random()*200);
}
function ranEquation(){
...........

or
function ranEquation(){..... /* this was used first to randomly generate and works with the trace function

Thanks

Randomly Generate In A Dynamic Text Field
Hello everyone! I am still having problems randomly generating some text in a dynamic text field box. I am new to flash 8 and I am struggling with the action script unless I have some guide to go by. But what I am trying to do is make numbers for ex. (1+1=, 2+2=, etc.) generate in a dynamic txt field at the click of a play button. I would greatly appreciate it if someone could help me.

[MX04] How To Generate A Value From A Button
Hi,

I'm developing a photo gallery. I've got a button inside a movie clip,
and I've duplicated it by the method attachMovie. The result is six
buttons. Now I want that when the user clicks on any button, this one
generate a value (numeric and consecutive: 1,2,3...) for a variable. What I want is to achive that these buttons go to a new gallery, and in this gallery it will be load different images depending on the value of this variable.

Thanks in advance

[MX04] How To Generate A Value From A Button
Hi,

I'm developing a photo gallery. I've got a button inside a movie clip,
and I've duplicated it by the method attachMovie. The result is six
buttons. Now I want that when the user clicks on any button, this one
generate a value (numeric and consecutive: 1,2,3...) for a variable.
What I want is to achive that these buttons go to a new gallery, and in this gallery it will be load different images depending on the value of this variable.

Thanks in advance

Generate A Random Letter From A Dynamic Pool Of Letters?
Hey,

The title says it all really.

I'm making a game where a random letter pops up and the player must press that particular letter on the keyboard within the time limit to gain a success. The more player successes, the larger pool of possible letters shown.

Successes's is a global variable and btnPool holds letters based on the number of successes. Eg, successes = 3, btnPool = a, b, c

I'm an artist really so my brain is fried. I assume its something like...

1. Generate a random number between 1 - 100 and store it.
2. Check how many letters are in btnPool then divde 100 by that number.
3. Allocate the relevant percentage of 100 to each possible letter.
4. Cross reference the stored random number with the percentages allocated to each letter.

And viola? Am i on the right track? Any help with the syntax?

Cheers for any help guys.

Generate A Button With Actionscrpt Code
Hi all!

This is my thread, I`m making a simple catalog of images, loaded dinamically from a folder in the server all this with actionscript, this is for a clothes store and you can see it in http://www.emporio.co.nr and when you click on a thumbnail in the screen it loads a big image in the left of the movie and fades all the screen, then I want to generate a button on the right side that say Buy Now and (onRelease) it takes me to another URL, can I do that, don't know the code.... can anybody help.

Thanks!

Button Press To Generate ENTER_FRAME..
Hey Guys,

Getting confused with this event handler stuff.

Im needing to have a button, which when clicked will run an EnterFrame function (to dynamically animate something).

I have managed to get something working as the below code shows, however this looks so inefficient with 3 seperate functions calling each other etc etc...

Could someone point me in the right direction to writing this "correctly"...


ActionScript Code:
bt_start.addEventListener(MouseEvent.CLICK, createEF);

function createEF(event:Event)
{
    addEventListener(Event.ENTER_FRAME, onEnterFrameAni);
}

function onEnterFrameAni(event:Event)
{
    // animate....

Cheers

How To Generate A Popup From A Hyperlink Insite A Dynamic Field In A Stand Alone .swf
Hello,

I have a dynamic field "padisplay" insite a stand alone .swf. This dynamic field displays summarized rows from a database. Each row that is displayed has an hyperlink called "full version". The goal is to optain a pop-up (when the hyperlink is clicked) that shows the full data related to that row. How can I handle this?

The used actionscript to display the data is
...
for (i=0; i < this.n; i++) {
padisplay.htmlText += this["lastName"+i] + "<a href='asfunction:showjpg," + this["picFile"+i] + "#" + escape(this["caption"+i]) + "'>&nbsp;&nbsp;(<font color='#0000cc'>full version</font>)</a>&nbsp;" + this["firstName"+i] + "&nbsp;" + this["phone"+i] + "&nbsp;" + "<a href='mailto:" + this["email"+i] + "'><font color='#FFFFFF'>" + this["email"+i] + "</font></a><br><br>";

Thanks for ypur suggestions

Generate Button, Attach Script, From Array?
Hello,
Does anyone have any helpful suggestions as how to A) generate a button and then b) attach script to it dynaimcally from an array?

Thanks,
Pete

[XML] Dynamic Text Can't Generate " > "
Hi all,

I got this movie where i parse some text from an XML file into Flash,

I used Embed font outlines to have AA text, but when i try to use " > " character in XML then the flash generates it as >

anyone have an idea ?

Is It Possible To Create A Dynamic Text Box Through AS
I have a requirement to create a dynamic text box at run time. i.e. it is not just the contents of the variable which I'm loading in, but also the font and size etc. This means that I cannot define the text box in advance.

Is it possible to either create a text box in actionscript or change the properties of an existing dynamic text box, such as font, font size, and the overall size of the text box.

Please tell me it can be done.

How To Create Dynamic Graph
hi there,

this is raheel, i want to create a dynamic chart or graph

using a text file called data.txt, by calling it into my fla using loadvarialbnum().

the graph only return the value if client press the refresh btn on the browser otherwise no request will be served.

hope u any one help to find my problem

rgds
Raheel

I Want To Create A Dynamic Menu But I Don't Know How. . .
I want to create a dynamic menu but i don't know how. I want to load the menu titles and url to go to from an xml. But more importantly i want to know how to dynamically genereate the menu preferbably using one base button to clone to make rest.

I have an idea how to clone it but i can seem to be able to reference the dynamic text within the button clip which serves as the button caption.

I thought i could simple reference the text value like: _level0.buttonclip.textfield.text but that didn't work please help.

I Want To Create A Dynamic Menu But I Don't Know How. . .
I want to create a dynamic menu but i don't know how. I want to load the menu titles and url to go to from an xml. But more importantly i want to know how to dynamically genereate the menu preferbably using one base button to clone to make rest.

I have an idea how to clone it but i can seem to be able to reference the dynamic text within the button clip which serves as the button caption.

I thought i could simple reference the text value like: _level0.buttonclip.textfield.text but that didn't work please help.

How To Create Dynamic Variable Name
Hey guys,

i want to create a dyanmic variable name and assign a value to it. so i wrote this function:

function bookmark( sendingVar )
{
for ( var i = 0; i < sendListLength; i++ )
(
eval(sendingVar+i) = 'C';
}
getURL("bookmark.html", "_blank", "GET");
}

however, when i compile it, it says:
Left side of assignment operator must be variable or property.
eval(sendingVar+i) = 'C';

So i try to do this instead
eval(sendingVar+i+"= 'C';");

but doesn't seem to work? any idea?

thanks in advance

justin

Dynamic Reflections - How To Create?
Hi - any ideas re how to creat dynamic reflections, eg as if a light were shining across a surface (glass/chrome) in flash?

not sure how to mask it .. appreciate any thoughts..

How To Create A Dynamic Calendar
how to create a dynamic calendar.??? one that can keep itself updated
Can it be done using actionscripts or any other kind of scripting?

Create Dynamic A Movieclip
Hello,

I want to create on-the-fly a new movieclip with a dynamic number of frames in it. How can I handle this? This number of frames is known in the mainmovie.

Please can anybody help me.

Eric

Create Dynamic Table
I'm trying to recreate a table I have in HTML...

I want to load a list of variables from an xml/text file, and then recreate a table i have somehow.

What would be the best way to do this?





ps;I haven't used Flash in over 3 years so I'm relearning everything again.

Is It Possible To Create Dynamic Variables
lets say i need a variable what is changing after period of time, by increasing in a number.

"variable = variable1" after a second it changes to "variable = variable2" .

Any idea how to make it change tht way?

Looking To Create Dynamic Zoom Map
I'm trying to create a map that has locations on it, when the mouse is close to one of those locations, the map re-centers and the closer you get to the location the more zoomed in the map goes.

I found a similar map here
http://www.lovesac.com/retail/map.php

I'm not sure where to start building something like this. I know how to create the motion and zoom, but the part where I'm fuzzy is the interaction with the mouse position. Any help?

How Do I Create Dynamic Textfields?
In AS3 I would like to create textfields dynamically in a loop:

var textContent1:TextField;
textContent1 = new TextField();
...
var textContent2:TextField;
textContent2 = new TextField();
...

How can I do that?

regards Martin

Create Dynamic Variable
How can I create dynamic variables in a for loop.


Code:
var ["team"+i"Bitmap"]:BitmapFileMaterial = new BitmapFileMaterial("team/images/mranderson.png");
["team"+i"Bitmap"].smooth = true;
Something like that?

How To Create Dynamic Component
Hi,

How to add anyone component in runningtime. But in that time no components to be stored in library.

Is it possible to load without library files? can you give any solution for this

Regards,
chandru

Create Dynamic Mask
I have a moviecliploader on my my main file, that loads a swf. Inside that swf, I have a circle.

Now, on my main file, I would like to create a dynamic mask. The shape of the mask should be the same shape as my circle.

Is it possible ?

Create Dynamic XML File
Hello

I am new here and happy to join the community

I've started to learn AS3 for 2 months now, and then tried to save an array created dynamicly during the use of my swf.

Is it possible to create a XML file with AS3 ?

thanks for help

(HOW) Create Dynamic Mc Instance Name?
I want to attach a behavior to a button which attaches new mc instance on release. Currently the code looks like this:


ActionScript Code:
on (release)
{
                attachMovie ("bar","newbar",1);
    newbar._x = _root._xmouse;
    newbar._y = _root._ymouse;
}

Obviously this create a SINGLE movie clip instance everytime because I always use the same instance name for it (newbar). How can I make the code generate unique instances.

I thought about anything like the following but it does not work.


ActionScript Code:
on (release)
{
               attachMovie ("bar","newbar"+i,1);
    ["newbar"+i]._x = _root._xmouse;
    ["newbar"+i]._y = _root._ymouse;
    i++;
}

Any hint?

How Do I Create Some Sort Of Dynamic Mp3 Bin.....
Hi guys..

I have something I wish to accomplish in flash, but Im not to sure what Im asking exactly involves.....

Esentially I want to have a folder on my Server/Website. Into this folder I wish to Place Mp3's

Then, On my flash website, I would like to have something like a Dynamic Text box, which somehow looks into the above mentioned folder, reads the Name Tags these files, and then displayes these names on the site as text link, linking to the file's URL, so a user can click on them and launch the song on his default Mp3 player, be it WMA or whatnot.

Thus I could update the music / listening section of my site by simply uploading the tracks into a folder....

Could anyone point me in the right direction I should look to get this accomplished.....??? It probabably involves Databases.... I hope not Any brainstorming or thoughts would also be greatly appreciated

I have a basic, reasonable knowlege of Flash MX, enough to finnish a nice, BASIC elegant site.... But I am no actionscripting expert....

So if anyone could help me out, It would be greatly appreciated

Cheers

How To Create Gif Of Mc With Dynamic Content?
Does anyone know how? Exporting to gif only includes the FLA's stage assets. I need to create screenshots which include loaded external .swf's and content created dynamically in AS. Doing it manually isn't feasible because I need to produce shots of hundreds of different views. Any ideas for automating the process? Can it be done from within Flash?

thanks!

How Do You Create A Dynamic Slideshow?
How do you create a dynamic slideshow using flash cs3? Let me explain: We
have "Customer" definable html slideshows that a user can manually click
through. The customer can go to a maintenance area and Add, remove or
hcange any photo in any category and also change order in which it is
viewed. Very simple code using ASP.NET. Now how do i get Flash to do the
same. The above solution is completed by using a database list. Does Flash
read Databases, if so problem solved, but where is the script for it. If
not, what is another solution so my customer can edit the list of photos via
the internet using one of our ASP.NET modules.

Thank you in advnace for your help. If have looked everywhere for solutions
on this and have only found during SWF creation solutions not post SWF
creation.

Create Dynamic Trajectory
I have an animation with an airplane that flies on the stage from one end to the other. I have made a curve trajectory using motion tween, but I would like to create a random dynamic trajectory. Any idea how can i do that ? Is is possible to create dynamic motion tween ?

Best Way To Create Dynamic Buttons?
Hi, another "newbie" question I think...

I'm creating an Internet app in Flash that will use several types of screens, and the main user-control element is buttons (For OK, Advance, Play, etc.)

The standard button "component" doesn't work for me, because I need a very specific graphical look, with close control over the exact placement and operation of an icon on the button.

So basically I want to "roll my own" buttons, using the Button object with my own graphics, and placing a caption and icon(s) on top. The buttons need to be dynamic, too, so I can create and delete them at will, change their captions, icons, etc...

What is the best way for me to go about this, architecturally? My ideas so far:

1) Use symbols for the buttons, and programatically create labels and graphics to put on top of them. Possible, but highly annoying, since I have to keep track of the positions of 3 elements together, for adding, deleting, modifying... I tried putting the label and graphics in the symbol, until I realized that you can't modify an individual instance...

2) Create my own component. This looks like a huge hassle, though, that I'd rather avoid.

Really, I'm just looking for a simple way to create and modify buttons dynamically with my own special graphics, ideally without all the overhead of components and everything... Are these two the only possiblities, or am I missing something else?

Thanks
Michael

Create Dynamic Textboxes From XML
I need to dynamically create a number of dynamic textboxes based on the following:

1. each textbox is named after a specific nodename
2. its value is the attribute of that node

Basically I want to loop through an xml object and create a text box for each node, I presume it would work something like this:

//loop through nodes
for (i=0;i < recieveXML.firstChild.firstChild.childNodes.length ;i++)
{
// create dynamic tect box
//name after nodename
//assign node attribute as value
}

does anyone know how to achieve this?

Many thanks in advance!

Copyright © 2005-08 www.BigResource.com, All rights reserved