ActionScript 2.0 :: Storing/retrieving Color Data.. Php?
Nov 22, 2005okay, so i have a basic drawing app based on
drawing = false;
data = '';
_global.linethickness = "2";
[code].....
okay, so i have a basic drawing app based on
drawing = false;
data = '';
_global.linethickness = "2";
[code].....
I have a set of radio buttons which i need to retrieve the value from, store the value and pass it on to the next scene. I have tried using radio_btn.data, but it doesnt work.
View 5 RepliesI need a function that retrieves the average hexadecimal color values of a group of pixels in a square. Like a 4x4 area, and I want to be able to calculate what the average color is by retrieving the color of each pixel.
View 4 RepliesI'm currently making a color picker (pretty standard one, pretty much the same as photoshop with less options at the moment: still in early stage). Here's the picture of the actual thing : [URL] The problem is : to retrieve the color of the pixel that is under the color selector (the small one, the other is the mouse), I have this line that I thought would do it :
_currentColor = Convert.hsbToHex(new HSB(0,
((_colorSelector.x + _colorSelector.width/2)*100)/_largeur,
((_colorSelector.y + _colorSelector.height/2)*100)/_hauteur
));
Just to clarify the code, I simply use the coordinates of the selector in order to create a new HSB Color (saturation is represented on the X axis and brightness (value) on the Y axis of such a color picker). I then convert this HSB Color to Hexadecimal and assign it to a property. The hue is always set to 0 at the moment but this is irrelevant as I only work with pure red to test. It partially does what I wanted, but the returned color values are inversed for most of the corners:
[Code]...
Is there a way of finding out the color of a graphic? For example if i have an array of rectangles, each with a different color set using graphics.beginFill(), can I then do something like:
color = rectangleArray[i].getColor();
i am looking for some kind of library which does CRUD easily using PHP and MYSQL.My goal is to make some app in flash AS3.0 , where i will be receiving some data from user and storing in data base , and perform CRUD opertaions. I dont want to be so much involved in writing php and sl query.My scenario is:
Data types : [ like user_profile data, etc]
add under data types 1 to many fields with various types..
Database tables and realtions etc should be done by my DREAM library, then user when select a Dtat Type, he is presented with related fields to fill up data.
I will be using Flash AS3.0 ( Builder or IDE ) to perform .If only i can find some php library i think AMFPHP can connect flash with php
What is the best way to store data gathered from a flash file, and load it into another flash file? Would xml or php work? and could it be instantaneous? Here is a diagram of what i am trying to do...
[URL]
I need some help with my code please. I have a for loop that creates sprites and loads images into the sprites theough XML. I have additional nodes for each image and sprite that get created that I want to store and call when I roll over the thumbs. What would be the best way to do this? I had to "improvise" and have the for loop create text fields to hold the data and then call it when I roll over throught "evt.target.
[Code]...
I'm experimenting with data retrieval from xml spreadsheets. I have 5 links in the xml labelled:
<link0>index.html</link0>
<link1>about.html</link1>
<link2>portfolio.html</link2>
<link3>links.html</link3>
<link4>contact.html</link4>
In my movie, I have a loop, which upon each revolution a dynamic 'counter' ticks from 0 to 4, then resets etc:
[Code]....
i have xml structure.
<?xml version="1.0" encoding="utf-8"?>
<ul>
<li><a href="http://www.google.com">Google</a></li>
[code]....
I've just started out working with cookies in flash and looked at the poms tutorials [URL]Is there a list of commands that could get the users browser software etc for example?
View 2 RepliesI have XML data that is loaded into a mulitdimensional array.
I would like to call that information later in my actionscript but it seems that the array has not populated before I want to use it.
I am using the onload() method of the XML object.
I can trace the contents of the array directly after it is loaded with my loop, but later in the code a trace returns "undefined". My array is globally scoped.
I'm not even sure if this is possible, but I'm looking to retrieve a string from an embedded XML file, using a variable as the XML element's name. Here's what my code currently looks like, although it doesn't quite work:
Code:
private final function getAreaTitle(_index:int):String
{
var _element:String = map_XML.mapnode.@title[_index];
[Code]....
I'm not massively familiar with the XML format, so apologies if I've not explained myself very well. As you can hopefully see, I have one XML file containing my map data and another containing my text, such as area titles and locations. What I'm trying to retrieve in the example above is the string with the label "title_training" from the "text_XML" file. Of course, the function should be able to return the title for any area, so I need to find a way of converting "_element" in to the right format
When a key is pressed, data is sent to PHP to be stored in a MySQL database. For each key press, only one entry should be posted. it re-posts exponentially (e.g., 1st key press = one post, 2nd key press = two posts, 3rd key press = three posts; thus, totaling six posts).Initially, the event listener for key press existed alone on a single frame. When that was the case. This issue did not occur. I added an additional frame so that I could set to clear out all variables and start fresh.
so frame 4 will have :
KeyListener = new Object();
KeyListener.onKeyDown = function(){
if (Key.isDown(69)){ // if key pressed is "E"
[code]....
There is a combo-box by the name "cbJobs" and it gets its value from the XML file named "data.xml".. I want to store the value transferred from this XML file into a variable.. so basically someone told me to use the code
on (change) {
_root.subject = this.getValue();
}
the only problem with this code is that it gets activated only after I "change" the value in combobox by pulling it down.. I want to use this value obtained from _root.subject as a subject in the script
getURL("mailto:abc@abc.com?subject="+_root.subject);
I'm now writting a little drawing tool, that will allow users to save their drawings and the redraw them. Now I'm only concerning myself with diferent colored lines with diferent thickness. So now I only need to store the values, that will be used later on when calling the canvas object's graphics.lineTo(....); method. I'm planning to save all of my drawings in XML, but I still need to load them up when I want to use them.
Given my situation, what's the best way to load up my data (after loading it in chunks): Arrays, Dictionaries, anonymous objects. We're talking about loading up, let's say ~ 1000 Point instances for a very simple shape, since I want the drawing to be pixel-perfect, since I will be modifying it to a more sophisticated tool later.
I'm currently having abit of problem with splitting some data and inserting it correctly.On screen I am going to have 3 movieclips (with a dynTextfield already placed inside them).Using data imported from PHP I plan to put the project names of the returned results inside the movieclips. The problem with this is if the results are more than 3 then there aren't enough movieclips. To over come that I was thinking of using a 'more' button where the project names would get pushed out of the movieclips and the new set loaded in/along.
At the present moment I can split the data (received from PHP) and trace it accurately, although I'm not sure how to go about storing it now. I was going to use and Array and store to store the info and call it in the buttons, however I haven't used arrays before.
Code
Code:
function fetchInfo(){
//Query DB for existing projects:
fetchProjects = new LoadVars();
fetchProjects.userID = _global.UserID;
[code]....
At the moment in my test there are 2 results that are returned.
I was wondering what the easiest way to store a small amount of data on the server would be.
Basically I wanna keep a hiscore table for a flash game, and would need to store juz a couple of names and a couple of score in a little file, but i havent the faintest idea how to go about it.
I have a page, written in php that recives and ID value for Album information stored in an XML file. The XML File contains a links to "Samples": I'm trying to get my flash file to "retrive" the data (the ID value) from the php page (the flash file will be embedded), and make a list of samples that can be played. A sorta of an Audioplayer. I already know how to retrive XML data, but the retrival of the ID value from the PHP is a puzzle for me...
View 5 RepliesI'm using mx.rpc.http.HTTPService to retrieve data from a web service. On the initial call to "loadWsData", HTTPservice accurately retrieves all the data.
However, on any and all subsequent calls HTTPService does not accurately retrieve the data; rather it always retrieves the first data set. I've confirmed that the web service is providing accurate data, both from web browsers and a ruby ws client script.
[Code]...
i have a datagrid which grows in size depending on the result of a call to my db. The call to the database returns an object with 30+ values for each row. When the number of rows returned exceeds about 80-90 the datagrid renders odd. It displays the first 50-60 rows fine but then it displays blank rows and they even continue to display outside the border of the datagrid.what is happening? Im using mxml webservice to retrieve the data.
<mx:DataGrid dataProvider="{resultsData}" rowCount="{resultsData.length}" allowDragSelection="false"
id = "confRoomLookupResults" width="948"
[code].....
i've been setting up a high score table in my game, and everything is working, but i cant work out how to get variables from the URLLoader.data that im retrievingif i trace loadedScores.data, i get this&name1=matt&score1=323250&name2=1234567890123456.. . and so o've tried passing it to a URLVariables constructor, but it says the string doesnt contain the correct name/variable pairs or something, and loadedScores.data.name1 doesnt work.
View 8 Repliesi'm trying to make it easy for artists and level designers to implement game entities without writing a drop of code.
for instance, 5 different monsters are similar but with different attack speeds. i'd like to embed stats (for instance attack speed, health, etc.) in each of their movieclips.
the only way i can think is to embed textfields with instance names of "attack speed" and "health", and then delete the textfields at runtime. is there a more legitimate way of doing this?
I have a simple Flash slideshow that reads XML
The XML files contains a few settings and several data entries
I want to make it read from a database instead
I can't make my mind up how I should use the database and how many tables I need
IMPORTANT: I will have several instances of the same slideshow on several different places - how to best store the data
I'm goofing around with developing a Flash game that would be accessible via a Facebook application but am still trying to figure out how I want to organize the game itself. The game essentially is an educational game with competitive components - completing tests faster results in more points with which you can customize your avatar and other items in the game. Also, passing certain "lessons" open up new lessons. So the major components I see are:- Player data storage (scores, progress, etc.)- Social connections - transference of rewards, comparing high scores, etc.- Lesson data (what questions to ask, possible answers, etc.)How is this best controlled? PHP and SQL? XML? Should I use datagrids as an intermediary? I'm having a lot of problems finding good information, both on the internet and at the bookstore about how to manage this.
View 3 Repliesi'm trying to find a solution to this problem: in the frist frame of the project i have 3 radiobuttons (Mambasradio, Amaronradio, Mastajbuonradio). In the second frame i have a ComboBox (Centers). I created 4 Arrays (mambascenters, amaroncenters, mastajcenters, nothing) and i tried to change the Array of the Centers.dataProvider with the RadioButtons selections. So if i selected Mambasradio, the dataProvider will beCenters.dataProvider = new DataProvider(mambascenters)I tried a lot of things but i didn't figured out of this. It gives me a Null Object Reference error in second frame. Here's my code.
Frame1
import flash.text.TextField;
import fl.events.DataChangeEvent;
[code].....
how "you" would do it and then deciding my strategy from there.What I'm setting out to do is as follows:I have a UI with about 10 sliders and 10 buttons.I'm using Senoculars Virtual Mouse class to record all of the users interactions into arrays (basically [x,y, action, time, value]) and then after a decided time (say 3 minutes) I play the users interaction back to them.All of that works fine but now the data is not persistent.I would like to be able to store the interaction data somewhere and then a user can log out, log in and view their previously saved interaction.how would you go about saving this data? I was thinking about storing it in a XML file but I'm concerned that the file would wind up being ridiculously huge. If a user drags a slider from left to right just once thats saving [x ,y action, time,value] 42 times.
View 3 RepliesI am making app that works as stand alone, do some calculations and sting formating. Also it need to save data localy, and be able to reload it when needed. I have read that Shared Objects do that but also have limitation. For example the data can be deleted without user doing it. I need the data to somehow persistend and been able to delete only by the user of the app. As extra exporting data for other user will be usefull, but is not requared.
View 1 RepliesI am making app that works as stand alone, do some calculations and sting formating. Also it need to save data localy, and be able to reload it when needed.I have read that Shared Objects do that but also have limitation. For example the data can be deleted without user doing it. I need the data to somehow persistend and been able to delete only by the user of the app. As extra exporting data for other user will be usefull, but is not requared
View 2 RepliesI have a input text field on the first frame. I want to use the data from that text field in the next frame how do i do that using an array or a string.
View 1 Replies