Set/get Color Variable For E-card
hi
i have an e-card flash project that emails the dynamic postion and color of draggable MCs on the stage. it consists of 2 files, one is the writer.swf, which is changed by the sender, and one is the reader.swf that displays the card. the only thing i have left to figure out is how to set the variable for the color of the objects and send it to the reader to display it. her is my code for the button that sends the variables (which doesn't work yet):
on (release) { // did they enter an email address yet? if (_root.email != "" && _root.email != null) { // This code generates a (hopefully) unique session ID for this card // If you end up with overlaps you're either very succesful or extremely unlucky myDate = new Date(); ranNum = Math.round(Math.random()*1000000); ranChar = chr(Math.round(Math.random()*24)+97); session = (mydate.getMonth()+""+myDate.getDate()+""+mydate.g etFullYear()+""+ranNum+ranChar); // Now we construct the layoutString which goes to the reader.swf layoutLength = items.length; for (j=0; j<layoutLength; j++) { _root.name = items[j]; xpos = _root[_root.name+j+"x"]; ypos = _root[_root.name+j+"y"]; color = new Color(_root[_root.name+j+"color"]); mcColor = color.getRGB(); // if the layoutString exists, append data if (layoutString != null) { layoutString = layoutString+","+name+","+xpos+","+ypos+","+mcColo r; } else { // layoutString doesn't exist, create it layoutString = name+","+xpos+","+ypos+","+mcColor; } } // Since we're now going to send variables to a script, let's clean // up those we don't need delete items; delete j; delete name; delete myDate; delete ranNum; delete ranChar; delete layoutLength; delete xpos; delete ypos; delete mcColor; // Passing the variables: // Here I'm using LoadVariables because I want the user to stay IN the flash file // when they send their card. If you want them to be re-directed to your PHP page // use get URL - getURL ("e-card.php", "", "GET"); getURL ("http://207.226.147.46/php/e-card.php", "", "GET"); } else { // no email addy enterred, report error _root.email = "- Please enter a valid email address here -"; } }
then the reader file takes this info and attaches the MCs to the _root to display the sender's work. this code in frame one of the redaer files looks like this:
stop (); // prepare loaded variables // there are 4 elements in each of my array entries in the form: // [mc name, _x, _y, mcColor] // thus I set my arrayLength = 4 arrayLength = 4; // our loaded array has been loaded as a string which we must now // convert into a valid array using the split object locationArray = locationString.split(","); // numOfElems tells how many objects are fully defined in the // loaded array numOfElems = locationArray.length/arrayLength; // now we loop and place those elements defined in our array, loopCount = 1; for (j=0; j<=numOfElems; j++) { mc = locationArray.shift(); xpos = Number(locationArray.shift()); ypos = Number(locationArray.shift()); mcColor = Number(locationArray.shift()); _root.attachMovie(mc, mc+j, j); _root[mc+j]._x = xpos; _root[mc+j]._y = ypos; _root["mcColor"+j] = new Color(_root[mc+j]); _root["mcColor"+j].setRGB(); }
this doesn't work either. i'm not sure which one is wrong, or even if they both are. anyone ahve any suggestions? please let me know if you need more info. thanks for all your help!
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-28-2001, 01:35 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Color Variable For Flash E-card
hi
i have an e-card flash project that emails the dynamic postion and color of draggable MCs on the stage. it consists of 2 files, one is the writer.swf, which is changed by the sender, and one is the reader.swf that displays the card. the only thing i have left to figure out is how to set the variable for the color of the objects and send it to the reader to display it. her is my code for the button that sends the variables (which doesn't work yet):
on (release) {
// did they enter an email address yet?
if (_root.email != "" && _root.email != null) {
// This code generates a (hopefully) unique session ID for this card
// If you end up with overlaps you're either very succesful or extremely unlucky
myDate = new Date();
ranNum = Math.round(Math.random()*1000000);
ranChar = chr(Math.round(Math.random()*24)+97);
session = (mydate.getMonth()+""+myDate.getDate()+""+mydate.g etFullYear()+""+ranNum+ranChar);
// Now we construct the layoutString which goes to the reader.swf
layoutLength = items.length;
for (j=0; j<layoutLength; j++) {
_root.name = items[j];
xpos = _root[_root.name+j+"x"];
ypos = _root[_root.name+j+"y"];
color = new Color(_root[_root.name+j+"color"]);
mcColor = color.getRGB();
// if the layoutString exists, append data
if (layoutString != null) {
layoutString = layoutString+","+name+","+xpos+","+ypos+","+mcColo r;
} else {
// layoutString doesn't exist, create it
layoutString = name+","+xpos+","+ypos+","+mcColor;
}
}
// Since we're now going to send variables to a script, let's clean
// up those we don't need
delete items;
delete j;
delete name;
delete myDate;
delete ranNum;
delete ranChar;
delete layoutLength;
delete xpos;
delete ypos;
delete mcColor;
// Passing the variables:
// Here I'm using LoadVariables because I want the user to stay IN the flash file
// when they send their card. If you want them to be re-directed to your PHP page
// use get URL - getURL ("e-card.php", "", "GET");
getURL ("http://207.226.147.46/php/e-card.php", "", "GET");
} else {
// no email addy enterred, report error
_root.email = "- Please enter a valid email address here -";
}
}
then the reader file takes this info and attaches the MCs to the _root to display the sender's work. this code in frame one of the redaer files looks like this:
stop ();
// prepare loaded variables
// there are 4 elements in each of my array entries in the form:
// [mc name, _x, _y, mcColor]
// thus I set my arrayLength = 4
arrayLength = 4;
// our loaded array has been loaded as a string which we must now
// convert into a valid array using the split object
locationArray = locationString.split(",");
// numOfElems tells how many objects are fully defined in the
// loaded array
numOfElems = locationArray.length/arrayLength;
// now we loop and place those elements defined in our array,
loopCount = 1;
for (j=0; j<=numOfElems; j++) {
mc = locationArray.shift();
xpos = Number(locationArray.shift());
ypos = Number(locationArray.shift());
mcColor = Number(locationArray.shift());
_root.attachMovie(mc, mc+j, j);
_root[mc+j]._x = xpos;
_root[mc+j]._y = ypos;
_root["mcColor"+j] = new Color(_root[mc+j]);
_root["mcColor"+j].setRGB(_root[mc+j]);
}
this doesn't work either. i'm not sure which one is wrong, or even if they both are. anyone ahve any suggestions? please let me know if you need more info. thanks for all your help!
Creating A Variable E-card Id
I hope I covered all options in my subject. My site involves creating composite images and the closest example of code I need is from ecards etc... When these are emailed to people they have a long string a vars which I presume interacts with flash and a script. Any ideas where I can learn how to do this. I've searched the forum but cannot find anything of help.
Thanks
[F8] Memory Style Card Game Card Flipping Issue
Hey guys,
I need a little help with a project I'm doing for school. I'm designing a memory style card game where you flip cards over and if they match they go away and stuff. You know what I mean. Anyway, I can't figure out how to tell both cards to revert to their original state if you guess wrong.
I have the last card you pressed flipping back over no problem. It's just the first one that won't do anything and I can't figure out how to reference it.
If anyone can help that'd be great.
Hex Color As Variable In Color Object?
im trying to do this
myColor = new Color(myMC);
myColor.setRGB(variable);
we have all of the colors we need in css info in a database but im attempting to use the same values in flash. i can load the variables in fine but when i try to set them as a hex color it just assumes the letters are hex colors.
any suggestions
Set Color Variable?
hiya!
i'm wondering how to set a variable for the color of a MC. i've tried a few things but nothing has worked yet. I need to set the color variable in the same format as these variables below:
name = items[j];
xpos = _root[name+j+"x"];
ypos = _root[name+j+"y"];
rotation = _root[name+j+"rotation"];
height = _root[name+j+"height"];
width = _root[name+j+"width"];
anyone have any ideas??? thanks!
justin
Set Color By Variable Instead Of RGB Value
hi
I have a peice of code that takes a number from a variable loaded from a PHP script. this is my code:
set ("_root."+this._name+"cobj", this.colortext(_root[mc+j]));
my problem is that it's not getting the number, but if i pre-set the number it works like so (for blue):
set ("_root."+this._name+"cobj", this.colortext(255));
acan anyone tell me how i can make the vraibel work so that it recognizes the number? thanks!
Color By Variable Txt
hey guys. whenever i get really stuck on somthing i come ask you guys.
so far so good. i have a question about colors by variable.
i know how to call buttons and text by external txt file.
but i would really like to lean to do this with colors, and the width of a movieclip.
can someone post a quick overview?
Different Color For Variable
I have:
myText = myText + "<b>location: </b>" + locale[p]+newline;
how can I make the content of local[p] a different color? lets say grey.
thanks
Get Color Value Through Variable
hi!
i read the tutorial on this site abt changing the color values of an object, or of a movie clip. it is really nice explained, thanks. my question is:
how can i get the value of a color from a variable. if i click the button, some rgb value should be stored in a variable and through some function i should get it. i wrote the function something like this:
------
on (press) {
var colorful = new Color("_root.shapes");
colorful.setRGB(myVariable);
}
-------
but it's not working. can anyone help me?
ssjogus
** i am a designer, so do not know much of action script !!
ssjogus
Get Color Value Through Variable
hi!
i read the tutorial on this site abt changing the color values of an object, or of a movie clip. it is really nice explained, thanks. my question is:
how can i get the value of a color from a variable. if i click the button, some rgb value should be stored in a variable and through some function i should get it. i wrote the function something like this:
------
on (press) {
var colorful = new Color("_root.shapes");
colorful.setRGB(myVariable);
}
-------
but it's not working. can anyone help me?
ssjogus
** i am a designer, so do not know much of action script !!
ssjogus
Color Variable Question
hi
does anyone have any ideas how i could format my code to get a color variable in the same way this code below is written? i want to keep all the variables, and add in one for "color". thanks for your help!
for (j=0; j<=numOfElems; j++) {
mc = locationArray.shift();
xpos = Number(locationArray.shift());
ypos = Number(locationArray.shift());
rotation = Number(locationArray.shift());
height = Number(locationArray.shift());
width = Number(locationArray.shift());
_root.attachMovie(mc, mc+j, j);
_root[mc+j]._x = xpos;
_root[mc+j]._y = ypos;
_root[mc+j]._rotation = rotation;
_root[mc+j]._height = height;
_root[mc+j]._width = width;
}
justin
Reading Color Variable?
hi
i need to read a set color variable, which was set like this:
mcColor = new Color(_root[name+j]);
RGB = mcColor.getRGB();
as a variable in the same format as this:
xpos = Number(locationArray.shift());
ypos = Number(locationArray.shift());
rotation = Number(locationArray.shift());
height = Number(locationArray.shift());
width = Number(locationArray.shift());
_root.attachMovie(mc, mc+j, j);
_root[mc+j]._x = xpos;
_root[mc+j]._y = ypos;
_root[mc+j]._rotation = rotation;
_root[mc+j]._height = height;
_root[mc+j]._width = width;
i need to add the variable in both formats above, any ideas??? thanks!
justin
Make Color Variable
hi
i need to make a variable for color in each of the same formats below, any ideas??? thanks!
xpos = Number(locationArray.shift());
ypos = Number(locationArray.shift());
rotation = Number(locationArray.shift());
height = Number(locationArray.shift());
width = Number(locationArray.shift());
_root.attachMovie(mc, mc+j, j);
_root[mc+j]._x = xpos;
_root[mc+j]._y = ypos;
_root[mc+j]._rotation = rotation;
_root[mc+j]._height = height;
_root[mc+j]._width = width;
justin
How To Use Variable In Color Object?
I would like to use a variable in the color object but dont know how to. What I am using is:
myColor = new Color(bg);
myColor.setRGB(bgcol1);
Here the RGB value is stored in the variable bgcol1 which is '0xffffff'. But its not working. I am getting the variable bgcol1 from a database. Is there a way to use the variable in the color object?? I have a book in which I want the pages in different colors and so I have taken a variable bgcol in the database and bgcol1 corresponds to page 1's color and so on. I am being able to get the correct values in the variables but somehow in the color object it doesnt work. Kindly help.
Using Variable Color Target
take this script:
var newColor:Color = new Color (target_mc);
Is there any way to have the target be a variable that I can change dynamically? I hope someone knows how to do this as it will greatly solve a problem I cannot get past. Thank you in advance.
Robert
Color By Variable Text
OK so i have a movie
20 frames total.
on frame one i have
Code:
loadVariables("projects.txt", "_root");
_global.changeColor = function(obj, newcol) {
obj.myColor = new Color(obj);
obj.myColor.setRGB("0x"+newcol);
};
changeColor(BarOne, "0000ff");
my question is
how to i set the "BarOne, "0000ff"); to call a hex from the .txt file.
basicly i want the users to be able to edit the color of the object by changing the hex's on the .txt file,
can anyone find a solution?
here is what i tried to do, and it didnt work
Action-
Code:
changeColor(BarOne, "bar_color");
.TXT File
Code:
&bar_color=0000ff&
im expecting im way off from the solution
~Warp
How Do I Use A Variable To Change A Color?
Hi Folks!
I want to set a color with the operation
setRGB
and as log as I use the direct Hexadecimalstring is everzthing perfect, ilke
setRGB (0xFF0000);
But I want to use a variable instead of the string and there is my Problem.
The variable is set with getData from a Radiobutton and I tried to set it like this
RGB=0xFF0000
but then I don't know how to use the Variable, I tried it like that
setRGB (RGB) or setRGB ([RGB]) --> its not correct
In the example in the manual they use (given that the adressed mc contains my color)
RGB=myMc.getRGB.toString (16);
but if I do that and trace RGB, the Trace is [type function] and not a HExadecimalstring like they say.
Here is the code I work on:
PHP Code:
RGB = cor1.getData (); //gets the string 0xFF0000
trace (RGB);
_root.myColor.setRGB (RGB); // doesn't work
// just to test how it is working
_root.corMalha.setRGB (0xFF0000);
rgb=_root.corMalha.getRGB (); //if I add .toString trace returns [type Function]
trace (rgb)
the trace is:
0xFF0000
16711680 //which is the decimalnumber for FF0000 in Hexadecimal
I am
Pls help
Thanxx in advance
Syntax To Store A Color As A Variable
Hi,
I was attempting to help someone out on the newbie board and found my knowledge of the color object let me down, always more to learn.
Basically he has this on a button,
on (release) {
_root.mc2Color = new Color("_root.mc2");
_root.mc2Color.setRGB(0x663300);
he has various buttons for different colors.
we need to store the color set by the button in a variable and then have an OnClipEvent(load) on other mc's read up that variable and set them to that color.
what do we store in the variable, and what syntax will properly combine the variable name with the color syntax to make the change.
thanks mark
Ms Versus Flash 5 ( Variable Color)
Folks,
I am having a problem with a scipt that i use for sent
variables in html to the flash movie, the script makes
it changes its colors.
the html code is
param name="movie" value="teste.swf?linha=ff0000"
the code that i use in flash 5.0 is
cCircle = new Color("linha");
cCircle.setRGB(parseInt(linha,16));
stop();
My guess is that flash mx works in a diferent way
ASP Variable -> Flash Background Color
Is it possible for ASP VBScript to communicate with Flash, say via:
<%
color=006600
%>
Have flash read that, and store the value in the active movie?
I have a movie that uses wmode to set it transparent. And as you know, Netscape's latest Browser doesn't render the transparent color. I wanted to provide a way in which if the user is using NN7 (all previous versions of MSIE 1-5.x and NN1-6.x take you to a "browser_unsupported" page) that I can pass a value to the flash movie so it creates the BG color depending on the page's code.
If M$ has done anything right, it would have to be how MSIE 6.x renders HTML. NN7 still has some minute flaws that I can't get rid of it seems, but it still shows the website close enough....
Backgroud Color Controlled By Variable
I am trying to make a movie that will have its background color determined by a variable. The way I figured would work is to create a movie clip that has different backgrounds on different frames. I called the movie clip "BG". Then I included an input text box with the variable assigned to it "myColor". Then I placed an AS on the MovieClip timeline like this:
if (_root.BG.myColor="blue") {
gotoAndStop (1);
}
if (_root.BG.myColor="red") {
gotoAndStop(2);
This does not work at all. Not only does it fail to advance the movie clip to the proper frame if I enter in the correct value for the variable, but it appears to assign a value to the variable automatically, in this case, "red".
How do I get this to work right? I tried adding _root.BG.gotoAndStop(frame number) just in case it was trying to advance the main movie to a different frame, but that did not help.
Any ideas?
Text-Color Change Via Variable Value?
MX 2004 Pro
Is there any way I could make my dynamic text field (variable "profit") to change its color whenever profit < 0 ? And then get it to go back to a standard black whenever it is > 0 again?
Changing Color Of Text That Is Variable
I am using Flash MX Pro. I have a movie clip with text loading from a variable.Is there any way to change the color of the text. i have tried everything and it seems to have no affect. One tutorial I read said to make sure the actionscript was in expert mode and how to do it. Problem is my version does not have that option.
If anyone can tiell me how to change the color of the text, I would be very grateful.
Taz
Variable Number Changes Ball Color?
1-15 ball = red
16-30 ball = blue
I have a ball and I want to change the color according to the variables value. Is this possible. What property do you use for an If statement?
I suck at script.
Is There Some Way To Create Custom Color Variable?
I'm creating a fairly complex animation frame-by-frame, but I would like to be able to change the color of certain parts of it dynamically. The only approach I can think of is changing each section into a movieclip, putting them all into an array and then looping through the array and assigning a color. However, the animation is long and since the colored shapes constantly change, I would end up with more than a hundred MCs.
A better option, if possible, would be to create a custom variable that I assign as a color in the color picker. So, instead of choosing a value like "#CCCCCC", I would be able to assign a name like "customColor", then I would dynamically change the value of "customColor" in AS3. Is that at all possible? Do you know of any extensions that add that functionallity?
Is There Some Way To Create Custom Color Variable?
I'm creating a fairly complex animation frame-by-frame, but I would like to be able to change the color of certain parts of it dynamically. The only approach I can think of is changing each section into a movieclip, putting them all into an array and then looping through the array and assigning a color. However, the animation is long and since the colored shapes constantly change, I would end up with more than a hundred MCs.
A better option, if possible, would be to create a custom variable that I assign as a color in the color picker. So, instead of choosing a value like "#CCCCCC", I would be able to assign a name like "customColor", then I would dynamically change the value of "customColor" in AS3. Is that at all possible? Do you know of any extensions that add that functionallity?
Pass Variable To New Color Object
I basically have an array of buttons and am looping through and assigning a new Color (instance name) to each.
Is it possible to pass a variable to a Color object like below?
Code:
buttons[i] = new Color (buttons[i]);
cos that aint working
If it can be done.... am I just using the wront syntax?
Is There Some Way To Create Custom Color Variable?
I'm creating a fairly complex animation frame-by-frame, but I would like to be able to change the color of certain parts of it dynamically. The only approach I can think of is changing each section into a movieclip, putting them all into an array and then looping through the array and assigning a color. However, the animation is long and since the colored shapes constantly change, I would end up with more than a hundred MCs.
A better option, if possible, would be to create a custom variable that I assign as a color in the color picker. So, instead of choosing a value like "#CCCCCC", I would be able to assign a name like "customColor", then I would dynamically change the value of "customColor" in AS3. Is that at all possible? Do you know of any extensions that add that functionallity?
Color Tween Variable Issue
I'm trying to learn AS3 by doing, so my skills aren't so hot - please bear with me.
I found some code done by senocular that uses the tween class to fade an MC from one color to another gradually.
I've modified it a little to accept new colors based on what button a user presses.
I want the code to function so that the color will fade from what it is currently, to what the newly assigned color is.
The problem is, right now the the fade always goes back to the startColor assigned on line 8. On line 25 I try to swap the startColor for the endColor as part of the function 'interpolateColor' - but it doesn't work like I'd hope.
I've tried that same swap as part of the 'doColorChange' function, but that just makes the target MC immediately change to the new color with no transition at all.
Any insights, anyone?
ActionScript Code:
import fl.transitions.*;
import fl.transitions.easing.*;
// start and end colors for tween
var startColor:ColorTransform = new ColorTransform();
var endColor:ColorTransform = new ColorTransform();
//endColor.color = 0x00aeef; // end color of red
startColor.color = 0xffffff;
endColor.color = newColor; // end color of red
//new color
var newColor:uint = 0xffffff;
// function to transition from one colorTransform to another
function interpolateColor(start:ColorTransform, end:ColorTransform, t:Number):ColorTransform {
var result:ColorTransform = new ColorTransform();
result.redMultiplier = start.redMultiplier + (end.redMultiplier - start.redMultiplier)*t;
result.greenMultiplier = start.greenMultiplier + (end.greenMultiplier - start.greenMultiplier)*t;
result.blueMultiplier = start.blueMultiplier + (end.blueMultiplier - start.blueMultiplier)*t;
result.alphaMultiplier = start.alphaMultiplier + (end.alphaMultiplier - start.alphaMultiplier)*t;
result.redOffset = start.redOffset + (end.redOffset - start.redOffset)*t;
result.greenOffset = start.greenOffset + (end.greenOffset - start.greenOffset)*t;
result.blueOffset = start.blueOffset + (end.blueOffset - start.blueOffset)*t;
result.alphaOffset = start.alphaOffset + (end.alphaOffset - start.alphaOffset)*t;
return result;
startColor = endColor;
}
function doColorChange ():void {
endColor.color = newColor;
var tween:Tween = new Tween(clip, "", Strong.easeOut, 0, 1, 50);
tween.addEventListener(TweenEvent.MOTION_CHANGE, tweenTransform);
function tweenTransform(event:TweenEvent):void {
clip.transform.colorTransform = interpolateColor(startColor, endColor, tween.position);
}
}
// Test Buttons
btn_1.addEventListener(MouseEvent.MOUSE_UP, onBtn1Up);
function onBtn1Up(evt:MouseEvent):void{
newColor = 0xff0000;
doColorChange(); // end color of red
}
btn_2.addEventListener(MouseEvent.MOUSE_UP, onBtn2Up);
function onBtn2Up(evt:MouseEvent):void{
newColor = 0x00aeef;
doColorChange(); // end color of red
}
[Flash 8/AS2] Best Way To Pass Color Variable From Xml To MC
I have an XML file that is passing the color that is needed on a movie clip.
I can make the color variable in the XML the actual HEX number and that works fine.
Example:
Code:
//XML
<ColorData>
<!--1001-->
<ClipColor mcColor="0x990000" /ClipColor>
</ColorData>
//Actionscript
my_xml = new XML();
my_xml.load("ColorMC.xml");
my_xml.onLoad = my_function;
my_xml.ignoreWhite = 1;
function my_function() {
var mc1001color = my_xml.firstChild.childNodes[0].attributes.mcColor;
var newcolor1001:Color = new Color(mc_1001);
newcolor1001.setRGB(mc1001color);
}
But I would like to change the hex number in the xml into a a color name like red,
blue, green or gray to make it less confusing to the person generating the xml.
But I am having trouble tring to figure out how to change the color name back to the hex numbers
in the actionscrit.
I tried declaing the color names as variables with the hex numbers, but I am kind of stuck,
Everything I tried so far has not worked.
Code:
//XML
<ColorData>
<!--1001-->
<ClipColor mcColor="Red" /ClipColor>
</ColorData>
//Actionscript
my_xml = new XML();
my_xml.load("ColorMC.xml");
my_xml.onLoad = my_function;
my_xml.ignoreWhite = 1;
function my_function() {
var mc1001color = my_xml.firstChild.childNodes[0].attributes.mcColor;
var Red = 0x990000;
var Blue = 0x013E98;
var Green = 0x09913F;
var Gray = 0xBFBFBF;
var newcolor1001:Color = new Color(mc_1001);
newcolor1001.setRGB(mc1001color);
}
There are actully going to be over 600 movie clips to color so I would like to keep the code simple
and swap the hex number for the color names just once if posable.
Thanks for any help.
Changing Button Color By Variable
Is it possible to change the color of a button depending on the value of a variable ? If so does anyone have a simple example of code ?
Is There Some Way To Create Custom Color Variable?
I'm creating a fairly complex animation frame-by-frame, but I would like to be able to change the color of certain parts of it dynamically. The only approach I can think of is changing each section into a movieclip, putting them all into an array and then looping through the array and assigning a color. However, the animation is long and since the colored shapes constantly change, I would end up with more than a hundred MCs.
A better option, if possible, would be to create a custom variable that I assign as a color in the color picker. So, instead of choosing a value like "#CCCCCC", I would be able to assign a name like "customColor", then I would dynamically change the value of "customColor" in AS3. Is that at all possible? Do you know of any extensions that add that functionality?
Changing Color Of Text In String Variable
Hi,
I have a variable called fx:
house = "The house is a big 4 room house. Read more";
okay, - then I have a dynamic text field where I want my text.
Okay my text field var is also called house and I get the text all right,- BUT
I want the 'Read more' part to have another color than the rest and also a link.
How can I do that???
Regards
Godowsky
Variable Can't Be Defined In Movie Clip Color?
Hi
This script doesnt work... can't we actually have a variable while defining new movie clip color?
clr3=new Color(varValue);
clr3.setRGB(rgb);
doesnt recognize the movie clip name the varValue holds and hence doesnt change the movie clip color.
Help would be appreciated. Thanks in advance
Gohan
Defining Object Color In Flash By Asp Variable
Hi,
I'd like to define a color of an object in flash, by entering a hexcode value into a variable which is then passed on to the swf.
I really have no clue how to do this.
I read the tutor 'asp and flash' on asp101.com from Dan but i still don't seem to be able to figure out how to do this.
Any help would be greatly appreciated.4
[F8] Button Color Change Based On Ext. Variable...
Hello, All...
I'm having a dickens of a time figuring out how to make a button initially load a specific color based on the output of a variable in a txt file. I can get the 'dynamic text' version in the Help file to work, but what I'm wanting to do is this, and I can't seem to figure it out:
When the swf file loads, I need a variable read from blah.txt (say &a=2&), then based on that, when the scene loads, I need a button (button01) to either be green if 'a == 1', or red if 'a == 2'.
Any help or advice would be greatly appreciated.
Let me know if any other info is needed... I've been beating my head against the wall....
Thanks,
Dave
Filling A Shape With Color Based On Variable Value
Hi! I am working on a flash game. As the user goes through they accumulate points. Here is what I want to do:
When the user answers questions correctly it will increase the value of a variable. (each correct answer increases the value by 1). I have a heart (could be any shape) on the screen that is empty at the beginning of the game. As points are awarded I want that heart to slowly fill with a color.
Ideally I need to be able to set the highest point value (for example 500 points) and that correlate to 100% filled.
can anyone help me out with this one?
thanks,
aswhitehead
Setting Color From Loaded Variable In Textfile
I have a text file that set's some color values I would like to use in my flash movie. bascially its a config file for movieclips rollovers(set's the colors)
my textfile reads as follow
Code:
textOut=0x3F6075&baseOut=0xFFFFFF&outLineOut=0xE19C14
My Flash is as follows:
ActionScript Code:
/* loadconfig file */myTest = new LoadVars();myTest.load("button_styles.txt");myTest.onLoad = function(){ trace(this.textOut + newline + this.baseOut + newline + this.outLineOut);}/* function that actually changes the colors */function insideElement(){ myOutline.setRGB(this.outLineOut); myText.setRGB(this.textOut); myBase.setRGB(this.baseOut);}
Now when I trace the values its fine, but when i apply them to my movieclips, it turns black
any ideas? thanks
edit: of course i am calling the function, figured you would assume so,
Setting Color From Loaded Variable In Textfile
I have a text file that set's some color values I would like to use in my flash movie. bascially its a config file for movieclips rollovers(set's the colors)
my textfile reads as follow
Code:
textOut=0x3F6075&baseOut=0xFFFFFF&outLineOut=0xE19C14
My Flash is as follows:
ActionScript Code:
/* loadconfig file */myTest = new LoadVars();myTest.load("button_styles.txt");myTest.onLoad = function(){ trace(this.textOut + newline + this.baseOut + newline + this.outLineOut);}/* function that actually changes the colors */function insideElement(){ myOutline.setRGB(this.outLineOut); myText.setRGB(this.textOut); myBase.setRGB(this.baseOut);}
Now when I trace the values its fine, but when i apply them to my movieclips, it turns black
any ideas? thanks
edit: of course i am calling the function, figured you would assume so,
Variable Using No Textinput Just Inside SetRGB() To Put The Color From The Php File
I have this code:
Code:
colorTopo = new Color(this.Topo) ;
colorTopo.setRGB(0x363636);
I need to recieve the color value 363636 from some php or txt file. In php is like this:
Code:
$color = "363636";
colorTopo = new Color(this.Topo) ;
colorTopo.setRGB(0x$color);
How can I get this value from the file, put it inside a var so that i can put it inside the setRGB() to assign this color to the movie clip?
How To Change Color Of Dynamic Text Depending On Variable? Help Needed
I want to change the color of a dynamic text box depending on the variable's value.
For example, I have a dynamic text variable named "status1" which has a value that is loaded from a text file. If the value is "Yes" of status1, then I want to the color of status to be GREEN, if the value is "No", then I want to color to be RED.
Here is what I have right now (though it doesn't seem to work):
loadVariablesNum("data.txt", 0);
//THIS IS THE DATA INPUT FILE
if (status1 == "no") {
_root.status1.color = green;
}
Thanks.
SetStyle("color", Variable) Not Working
I can do setStyle("color", "#FF0000") and it works but when i try to do setStyle("color", variable) it does not work. The variable is an xml element and has the value "#FF0000". What could be wrong?
E-card
Can someone tell me how to create e-cards in flash or is there something like a tutorial somewhere?
I want everybody to be able to use my e-card(s). Each person will personalise his e-card with his own text...
Thnx...
E-card And ASP
I made changes on e-card tutorial which was writing in Cold Fusion to ASP and for some reason it send the email but the link on the email is not showing the e-card, here's the link...
http://www.nodoubtdesign.com/e-card.swf
Please let me know what's wrong with it
Thanks,
Sonic
E-card
I'm trying to make an e-card. I can make the movie, but don't know how to make it so that someone can e-mail it to another person, with some info in the body of the e-mail...Is this really easy, or am I going beyond Flash's capabilities?
E-card
Dear all,
is it somebody known how to do the flash e-card with asp server,
i am non-programming base flash user, need help, urgent.
jeand
E-card
Is it possible to do in Flash MX/asp an e-card set up where people can choose a picture then fill in their details etc and then that picture/animation be sent to an email address that they enter?
If so, how?
Cheers
|