ActionScript 2.0 :: Set Color From Loaded Variable In Textfile?
Jan 19, 2005
I have a text file that set's some color values I would like to use in my flash movie. basically its a configure file for movieclips rollovers(set's the colors)[code]...
View 2 Replies
Similar Posts:
Jan 19, 2005
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:
[code].....
View 2 Replies
Mar 3, 2010
I'm trying to load data from an external textfile, called "config_flash.txt". It works perfectly if applying the fetched data is done within the same function where the loading is done. However, I would like to use the fetched variables in other parts of the script.
Here's what works:
Actionscript Code:
var varLoader:URLLoader = new URLLoader(new URLRequest("config_flash.txt"));varLoader.addEventListener(Event.COMPLETE,
[code]...
So, basically I want the variables/values defined inside the function to be available anywhere in the script. The error that the second code snippet causes is as follows: "1120: Access of undefined property text1/text2".
View 6 Replies
Mar 15, 2007
I am trying to pass a variable from a text file into a variable in flash and trace it to screen. This is what I have done so far, but its not working. I have created a text file in the same folder as my flash. In the text file I have this:
loadedtext=hello
flash code:
function myFunction(){
trace("Data is loaded");
} var container:LoadVars = new LoadVars();
container.onLoad= myFunction;
container.load("demo1.txt");
trace(container.loadedtext);
View 3 Replies
Dec 1, 2002
Wanted to know if it is possible to make a bool-variable in flash that is set to 'false' by default. It then checks if a file exists at a certain location, and if so, the bool-variable is set to 'true' ?
Something like:
if (c:/myTextfile.txt == true){*do stuff here*;}
What would be the correct code?
View 6 Replies
Dec 21, 2009
Working in AS2, using CS3 Flash Pro I've simplified this to just the one little thing I'm trying to do.
countervariables.txt has this text in it:
[Code]...
The trace shows itemsPerMili as 'NAN' and totalForYear as 'undefined'. I know itemsPerMili yields 'Not A Number' because totalForYear comes up undefined, but oddly, the loaded variable does show up correctly in a dynamic text field assigned to the variable. I don't understand why it should show up in the dynamic text field correctly when it won't trace.
I want to see the number "3.80517503" in my trace for itemsPerMili.
View 3 Replies
Dec 23, 2004
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.
View 1 Replies
Dec 23, 2004
I read the tutorial on this site about changing the color values of an object, or of a movie clip. 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.
View 1 Replies
Aug 19, 2009
I created a flash application which loads in many other little flash applications (.swf files) based on menu selections. When I change one of the little applications the changes are viewable except when I change the background color.
After the first time I view the application, the background color changes do not carry over to the main app. I run the little ones stand alone and they show the new color, then I run the main app and any other changes I have made are there but not the color change. When I remove the file and the load fails, the old backround color still displays in the container movie clip the .swf was previously loaded into.
I have tried several different options and the only thing that worked was renaming and copying and deleting and making a big mess. There has to be a way to force a refresh of this mysteriously saved color. doesn't there?
View 3 Replies
Aug 1, 2009
I want to use a variable to set the color of text and graphics input by the user. I use the following code to set the variable:
var setColor:String;setColor = "0xff0000";
strokeColorBtn_mc.addEventListener(MouseEvent.MOUSE_UP, setStrokeColor);
function setStrokeColor(event:MouseEvent):void { setColor = "0xCCCCCC"; trace ("the new color is " + setColor);}
This works, and I am able to use the variable to set the color of type in a text field:
textFormat.color = setColor;
But when I try and use the variable to set the color of a graphic element:
designContainer.graphics.beginFill(setColor, 0.1);
I get the following error:
1067: Implicit coercion of a value of type String to and unrelated type uint.
So I thought that I might have to cast the String as a uint, so I tried the following:
designContainer.graphics.beginFill(setColor as uint, 0.1);
That eliminated the error message, but it does not change the color.
View 13 Replies
Nov 23, 2010
I have two variables:
var defaultMainHexidec:Number = 0xFFFFFF;
var mainHexidec:Number;
If a value isn't assigned to mainHexidec I assign the default value as follows:
mainHexidec = defaultMainHexidec;
trace("mainHexidec = " + mainHexidec);
The trace returns the same value as the value returned when tracing the defualt value. But if I use mainHexidec as the fill for a rectangle, the color is black while the default value is white (or any other color). If I set the color using the default variable the fill appears correctly. If I set the number using the number traced in either defaultMainHexidec or mainHexidec (it traces the same number) the color is correct.
View 5 Replies
Oct 31, 2008
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>
[code].....
View 2 Replies
Nov 16, 2009
I'm loading an swf file into my main application using URLLoader, I want to get the background color of the loaded swf file. ( I heard that one solution wold be reading the byte code of the loaded swf )
View 2 Replies
Jan 21, 2004
i'm trying to change the color of an instance that's inside an external .swf that i load into my main .swf
the code is basically this:
- in the main .swf:
this.createEmptyMovieClip ("portfolioConteudo", 101);
portfolioConteudo.loadMovie ("portfolio.swf");
[Code].....
when i click on myButton, the _root.portfolioConteudo.webContainer goes to _x position 50, but the color stays the same. but if i change the target of the corWebFolio to _root.portfolioConteudo, the whole swf becomes red, i mean, the code is right, except for the target path.
View 2 Replies
Mar 21, 2007
The fill function that I made works as long as you only need one color. How do I make a variable that will store the color? flash keeps giving me an error for trying to do it the way I am doing it.
Code:
fillit = function (d, e, f, g, color) {
color2 = "0x"+color
_root.lineStyle(1, 0x666666)
[Code]...
View 3 Replies
Jan 11, 2010
I'm trying to change the colour of a movieclip.I want to send a variable from Javascript within the html that the swf will be embeded in.I'm not quite sure where to start with this but this is my code:
[code]...
View 3 Replies
Mar 20, 2009
Simple URLLoader to get a textfile into a textfield.[code]Works fine locally, not on the server. I tried replacing it to the full http: URL to no avail.
View 3 Replies
Oct 4, 2005
I just make a simple system login that the username & password loaded from textfile then I store in array..but the problem is when I doing tracing nothing was trace..?this is the code I'm using for the flash
Code:
lv = new LoadVars();
myArray = [];
lv.onload = function() {[code].............
View 5 Replies
Jul 21, 2011
I am building a project where I got XML text displayed on a textfield. How can I change a specific word's color through actionscript 3 instead of doing it on XML? I though of creating a String variable for my word and then using that variable in my textfield.text, it works but is it possible to set a color for that variable?
View 3 Replies
Mar 7, 2012
hi guys! just asking how to save text to textfile using AS2.
View 1 Replies
Jun 13, 2004
Okay so I am new to using txt files, and not too great with arrays, but I think I should have this right. But when I try to trace the array, I get undefined!I found this on another thread, and changed it accordingly.
Code:
_root.textArray = new Array();
_root.text_lv = new LoadVars();
[code]...
View 1 Replies
Aug 1, 2004
I have a variable which takes a particular form of array (used with the component DataSet). It looks like this:
Code:
var recData = [{svenska:"Hej", spanska:"Hola"}, {svenska:"nej", spanska:"no"}, {svenska:"ocks�", spanska:"tambi�n"}];
I want to extract this variable from a textfile instead of writing it directly into the code-area of the flash-file, so I used the following code:
Code:
// 1) Loads the textfile, recieves the array, and puts it into a variable called txt_Data
var txt_DataSet = new LoadVars();
[Code]....
Unfortunately it seems the array gets converted to an ordinary string in the process, so I cant use it properly. Is there a way I could extract the array from this string again, and if so, how?
View 4 Replies
Aug 29, 2005
What I'm wanting to do is set the scale of a textfile (putted in an mc) at 200% and scale with a prototype on release of a button to 100 precent (its height).
View 2 Replies
Oct 16, 2005
I just load data from textfile into my flash file..so my problem is..how is it in flash I have to code so that I can edit the loaded data from textfile and then when I submit it'll update the data in textfile...of course I'm using php for writing in textfile...Currently I load the data into listbox from my textfile...is it possbile to edit the data from flash...
View 2 Replies
Oct 20, 2009
In have an application that uses buttons t0 load different text files. The problem is when I load the second text file I still get variables from the first one showing. To clarify things, suppose I load a file that displays variables 1 through 5 randomly when I click one button, then I click a second button in order to load a file that displays 6 through 10. The problem is that I still get some variables from 1-5 when I want to get only 6-10. Is the first file kept in memory or something? How do I unload or clear the temp/memory where the content of the first file is held.
View 1 Replies
Jul 5, 2011
using txt files, and not too great with arrays, but I think I should have this right. But when I try to trace the array, I get undefined!I found this on another thread, and changed it accordingly.
Code:
_root.textArray = new Array();
_root.text_lv = new LoadVars();
[code]....
View 3 Replies
Mar 26, 2003
I have loaded text on flash from an external txt. file. But when it comes to adding html to the files such as "font face" or to simply bold the text it won't work, I have check to have the html clicked on Flash, but the text just wont change.
View 9 Replies
Feb 6, 2010
i have a button, with instance name lightblue_color. I am assigning a color to its color field like this: lightblue_color.transform.colorTransform.color = 0x65ffff; then i am adding an eventlistener to the button like this: lightblue_color.addEventListener(MouseEvent.CLICK, ChangeColor); Then, in the function: public function ChangeColor(evnt:MouseEvent):void {trace(evnt.target.transform.colorTransform.color);} It prints 0. Why is that? Shouldn't it print 0x65ffff or do i need to do some type conversions?
View 2 Replies
Jun 8, 2010
I am creating a CBT course using Flash CS4 As3. I need to capture progress information from the user as they complete each unit in the course so that the next time they access the course they can pick up where they left off.
To do this I need to know how to write and retrieve this information to and from a text file or a cookie so that it can be retrieved re-enters the course.
View 1 Replies
Sep 27, 2011
i am at the last part of my project. it worked all well and reads all text fields from a text file as seen on :[URL]now i am trying to get the same thing working from MYSQL.Notice that the text file i used for index2.html is called [URL]and it was a direct copy/paste from the php page that gave the results from the MYSQL query. [URL] The problem is i am getting an error in [URL] which uses the php to get the text for the dynamic fields.
I get the following error:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at final_fla::MainTimeline/onDataLoad()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
my flash movie has 113 buttons called button_1 --> button_113 and 113 dynamic text fields tcname_1-->tcname_113
my AC3 code is the following:
// button links: to all buttons to open in iframe 'tdes'
// link corrosponds to button number
// i have 113 buttons.
[code]....
View 5 Replies