Getting Data From The Embed Statement?
I'm using Flash 8. I don't know if I'm saying all of this correctly so try to bare with me. Here's the long of the short of it.
I made a movie rater for myspace on request. The user enters in reviews and ratings and what not about each movie in a PHP form which stores the data in a flat file (text file). The swf calls that file and bases it's entire display on the contents.
The problem is that myspace doesn't allow swf files to access external scripts. The thing is, it does, just not through the actual swf file. I've looked at some of the flash mp3 players and they call in things like playlists and settings from xml files. The programs call these files in their embed statments.
Can anyone tell me how to do this? If I could get it to call my text files like that, I would be set. Any ideas?
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-05-2007, 07:36 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading Data From XMl File And Uses It To Run An If Statement. If Statement Fails.
[Flash CS3 (Flash 8 available as well)]
[Actionscript V2 (AS3 Not available for this project. End result must be in AS2. Plus I haven't learned AS3 yet)]
Hi
Sorry about running two posts so close together, but I couldn't change the other one to reflect the changes I've made in my problem.
The 1st post dealt with my theory that my IF statement wasn't written correctly, and so failed. But I've since disproved that.
Okay here is the situation.
I isolated elements from a larger app that I'm putting together and the problem still followed.
The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.
The purpose of the application is to load an XML file(works)
Populate 2 text fields with information from the XML file(works)
Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);
Heres the code:
Code:
runCode_btn.onPress = function() {
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {
if (success) {
//point to the first node with information
var track_xml = data_xml.firstChild;
//loop through each node
while (track_xml != null) {
//print out each node
test1 = track_xml.toString();
//point to the next node
track_xml = track_xml.nextSibling;
//Runs my code
//Define the contents of two text fields located in the movie
textOne = data_xml.firstChild.childNodes[3].firstChild;
textTwo = data_xml.firstChild.childNodes[5].firstChild;
trace("data_xml.firstChild.childNodes[3].firstChild = " + data_xml.firstChild.childNodes[3].firstChild);
trace("data_xml.firstChild.childNodes[5].firstChild = " + data_xml.firstChild.childNodes[5].firstChild);
/*dummyYes = data_xml.firstChild.childNodes[5].firstChild;
dummyNo = data_xml.firstChild.childNodes[6].firstChild;
dummyMaybeEmail = data_xml.firstChild.childNodes[3].firstChild;
dummyMaybeFax = data_xml.firstChild.childNodes[4].firstChild;*/
//Checks between the two text fields for a match
if (textOne == textTwo) {
trace("It is selected!" + textOne + " " + textTwo);
check_fax.selected = true;
} else {
trace("Ir is NOT selected!" + textOne + " " + textTwo);
check_fax.selected = false;
};
}
} else {
trace("error reading file");
}
delete data_xml;
};
data_xml.load("XML/dummy2 - email.xml");
};
After you read the code, you'll have noticed the trace commands I stuck in there.
They send this to the output panel:
Code:
data_xml.firstChild.childNodes[3].firstChild = 1
data_xml.firstChild.childNodes[5].firstChild = 1
Ir is NOT selected!1 1
So as far as I can see, it reads the XML file with no problems, it loads the text fields with no problem. But for some reason the IF statement refuses to recognize that both the XML nodes contain the same information.
If I alter the code like so:
Code:
textOne = 1;
textTwo = 1;
Then the IF statement works. It sees that the two text fields are identical in content, and the checkbox is selected.
So whats wrong with the Data from the XML file?
I haven't a clue.
I tried converting from a string to a Numeral using:
Code:
newText = Number(textOne);
But that didn't work, it just produced "NaN" when traced.
I tried populating the XML file with text versus numbers, still no luck.
What came from the trace:
Code:
data_xml.firstChild.childNodes[3].firstChild = hi
data_xml.firstChild.childNodes[5].firstChild = hi
Ir is NOT selected!hi hi
The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.
CheckBoxes are mandatory.
But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.
I'd really appreciate some help and suggestions with this, I think I'm out of ideas.
Thanks
-Lem
Parsing XML Loaded From Embed Statement
I don't know if I'm using the correctly terminology but I've made a movie rater in flash for MySpace. The problem is it doesn't allow script access. The music players on MySpace load xml files through the embed statment.
Now, I've done the same thing using this:
[code]
http://www.server.com/movierater.swf?myVariables=http://www.server.com/moviedata.xml
[/code
I know how to read xml files in actionscript (variable=moviedata.xml.firstchild.firstchild.node value; ) and all that good stuff. The problem is, I don't know how to read an xml file that has been loaded this way with out the actual load commands being in the swf itself.
Can someone please shed some light on this? I've searched google a million times and posted in many forums. I just don't know enough about this stuff to even know what to ask or search for.
Embed And Retrieve Meta Data In JPGs (?)
I’d like to know if there is a way to embed and retrieve meta data in JPGs. I know this type of information can be pulled from Mp3 files using the ID3 tags. I’m hoping to extract date, time and comment information from digital pictures without having to create a separate XML file.
Thank you.
Quick Question, If Statement On Blank Data From XML
Ok, it worked once but stopped working when I added more information into the XML database. Anyway, I have a section of my xml that has a URL it pulls in, but for some, there's not website to link to so I wanted to leave it blank. In XML, it looks like this:
<url></url>
I have my statement set up in the following code. The else statement works fine, but the if statement calling for nothing doesn't. Here's the code:
Code:
if (url[p]=="") {
url_txt.htmlText = "<p alight="right">No URL, See Description</p>";
}else{
url_txt.htmlText = "<p align="right"><a href=""+url[p]+"" target="_blank">"+url[p]+"</a></p>";
}
On the selections with no URL in my XML, it says Undefined, and the ones that have a URL, work as specified.
I've also tried making the if statment (url[p]==" ") but that doesn't work either.
I know its something easy, but I need a pair of fresh eyes to look at it as I've been coding this site for 2 weeks.
Thanks in advance.
Mxmlc -context-root And [Embed(source="/data/img.jpg")]
Hi.
I am using free Flex 2 SDK on Windows XP.
It came with mxmlc.
Current project directory structure:
Code:
proj_root/
src/
data/
All .as files are in proj_root/src/.
All .jpg files are in proj_root/data/.
In proj_root/src/Main.as:
Code:
[Embed(source="/data/img.jpg")]
I compile it with a batch file:
Code:
@echo off
mxmlc srcMain.as -output main.swf -context-root "%~d0\%~p0"
%~d0\%~p0 expands to absolute path of proj_root (build.bat is in proj_root).
However, I get this error:
Error: unable to resolve '/data/img.jpg' for transcoding.
I can use relative path ../data/img.jpg or /../data/img.jpg
Is there a way to use /data/img.jpg instead of above 2 versions of relative path?
Thank you.
Getting Data From Custom "<param =" Embed Tags?
I have a client who wants to embed the swf and have it read data from custom <param> tags. (Specifically not from flashVars, or the URL string. I don't know why. They are Client.)
For example:
<param name="movie" value="movie.swf" /><param name="someVariable" value="someValue" />
They'd like to get "someValue" into the swf.
Is this even possible? I've never heard of this and I suspect they're being ignorant, but I want to be completely sure before I tell the client to quit wasting my time on a holiday.
This is AS2 on a Flash 8 projector. No Javascript tricks allowed.
Embed Live Cue Data In Live Stream?
I am currently using the new FME to encode live to a FMS. Both applicatioins are running on the same machine. Is there a way to embed live cue and metadata into the live stream? Once embedded we want to record the stream AND send it on to viewers. Is there a way to process this on the server. The live cue and metadata is coming in the serial port.
Problem With Continue Statement And Label Statement
What am I doing wrong?
ActionScript Code:
var a = {
a:[1,2,3,4,5,6,7,8,9,0],
b:[1,2,3,4,5,6,7,8,9,0],
c:[1,2,3,4,5,6,7,8,9,0],
d:[1,2,3,4,5,6,7,8,9,0],
e:[1,2,3,4,5,6,7,8,9,0],
f:[1,2,3,4,5,6,7,8,9,0],
g:[1,2,3,4,5,6,7,8,9,0]
}
outerLoop: for(var i in a){
trace(i);
for(var j in a[i]){
trace(' '+j);
continue outerLoop;
}
}
Quote:
1039: Target of continue statement was not found.
Converting 'If Else' Statement To A 'switch' Statement
I am attempting to convert the following If statement to a Switch statement and I'm unclear as to the details of the execution of it. If someone could help me with this I would be very grateful. Here is the If statement followed by the shell of my attempted switch statement. TIA.
var spotOne:Boolean = true;
var spotTwo:Boolean = false;
var spotThree:Boolean = false;
var spotFour:Boolean = false;
btn.onRelease = function() {
f (spotOne) {
ball.slideTo(450, 100, 1);
spotOne = false;
spotTwo = true;
} else if (spotTwo) {
ball.slideTo(450, 150, .5);
spotTwo = false;
spotThree = true;
} else if (spotThree) {
ball.slideTo(100, 150, 1);
spotThree = false;
spotFour = true;
} else {
ball.slideTo(100, 100, 1);
spotFour = false;
spotOne = true;
}
};
---------------------------------
(attempt at conversion to switch)
var spotOne:Boolean = true;
var spotTwo:Boolean = false;
var spotThree:Boolean = false;
var spotFour:Boolean = false;
btn.onRelease = function() {
var location:Number = ?
switch(location) {
case spotOne:
ball.slideTo(450, 100, 1);
spotOne = false;
spotTwo = true;
break;
case spotTwo:
ball.slideTo(450, 150, .5);
spotTwo = false;
spotThree = true;
break;
case spotThree:
ball.slideTo(100, 150, 1);
spotThree = false;
spotFour = true;
break;
case spotFour:
ball.slideTo(100, 100, 1);
spotFour = false;
spotOne = true;
break;
}
Object And Embed Or Maybe Just Embed?
Can you solve the mystery for me. For years now I have put Flash objects into html pages by using the OBJECT tag and EMBED tag. I have placed the EMBED tag inside the OBJECT tag to make sure every browser sees the flash as recomended.
I am working on a Content Management System which allows the user to insert flash objects to the pages being managed.
As some of you may hae experienced the MSHTML editor (often used in WYSIWYG online editors like editworkspro.com) actually rewrites the object code which causes problems.
I have found one solution. The code is not rewritten if you only insert the embed tag - so skip the object tag surrounding it.
For some reason that works and IE (version 6 at least) can see the flash object. I thought the object tag was required!!
Now can someone tell me why the object tag is not required! And if It would be safe for me to skip it from now on.
Regards,
Sambo
This code works for an example in IE 6.
Code:
<*EMBED
pluginspage=http://www.macromedia.com/go/getflashplayer
src=flashfile.swf
width=295
height=328
type=application/x-shockwave-flash
quality="high"
bgcolor="#F2F4EE"
MENU="false">
<*/EMBED>
The * is just so that the board doesn't try to render the flash
Mx.data.components - Unable To Declare Data Component Types In External Class Files
Hi all,
FlashMX 2004, v7.2:
I am trying to declare instances of data-components (DataSet and DataHolder) in external classfiles, but Flash can't find the sourcefiles for any of the data component classes in the classpath.
According to the help-files, the classname for the DataHolder component is:
Code:
mx.data.components.DataHolder
Similarly, the classname for the ComboBox component is:
mx.controls.ComboBox
Code:
mx.data.components.DataHolder
In the following, the ComboBox gets declared, and the DataHolder generates a "Class can't be loaded" error:
Code:
class my_class extends MovieClip {
var my_cbox:mx.controls.ComboBox;
var my_data:mx.data.components.DataHolder;
function my_class() {
// constructor function
}
}
Sure, it fails because there is no "components" folder in the mx.data folder (at least on my system), and I have been unable to find any DataHolder.as file anywhere either, even though the documentation gives examples that reference the mx.data.components-folder for various data components. I even tried re-installing to make sure I had not accidentally deleted any classfiles, but still no luck.
Am I missing something really obvious here? Does anyone know how to successfully import, declare or otherwise make use of data-components in external class files? Any help greatly appreciated.
Send Form Data To A Php Script Which Writes The Data To A .txt File
Hi!
Ok, this might be very easy but I´m new to both AS and PHP so I´m struggling here and I havent found any useful tutorials to use only small bits here and there.
What I want to do: I have a form which send data to a php script which then writes the data to a .txt. This .txt file is then used by a .swf file to display certain values.
I also have 1 field that I want to use as a validation field as a simple(but yes, not very safe) way to make sure only the right persons submit information.
I have got the .swf file to read the .txt file so thats no problem.
Has anyone got any suggestions about how I do this?
I have an idea of letting the validation field be checked against a .txt file and if one of the lines in the .txt file matches the validation field the rest of the information is submitted and sent to the php script.
Difficult?
Many thx in advance!
Is There Anyway To Read Data In From A Text File And Populate An Array With The Data?
hello,
i'm new to flash, and i'm trying to create a photo gallery. however, the photos may not always be the same, and i need to have a way to easily change the pictures without having to go back into flash to change the code everytime. i thought a good way to do this would be to read the names of the pictures in from a text file and then use those names to populate an array, similar to the tutorial on creating a photo gallery on kirupa.com. the problem is, i have no idea how to do this. anyone have any ideas?
thanks
Converting Internal Array Data Into External XML Data [renamed]
I have this code inside my flash to name my navigation menu. Now I want to put this outside flash and load it via XML. How do save my different arrays into a variable for later use in my code?
In my nav fla (what i want to load from XML):
Code:
// MAIN MENU ARRAY
var mm_array:Array = ["MAIN1", "MAIN2", "MAIN3", "MAIN4"];
// SUB MENU ARRAY
var sm1_array:Array = ["sub1", "sub2"];
var sm2_array:Array = ["sub1", "sub2", "sub3"];
var sm3_array:Array = ["sub1", "sub2", "sub3"];
var sm4_array:Array = ["sub1", "sub2", "sub3", "sub4"];
var submenu_array:Array = [];
XML loading code
Code:
// LOAD MY XML
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
if (success) {
// what goes here to define: mm_array, sm1_array, sm2_array etc
myXML.load("myXML.xml")
XML file something like this:
PHP Code:
<navigation>
<menu>
<mm_array>main1</mm_array>
<sm_array>sub1</sm_array>
<sm_array>sub2</sm_array>
</menu>
<menu>
<mm_array>main2</mm_array>
<sm_array>sub1</sm_array>
<sm_array>sub2</sm_array>
<sm_array>sub2</sm_array>
</menu>
</navigation>
XML Data Displayer, Help Adding Multiple Data Fields Relating To XML
I recently used the Displaying XML Data tutorial, but cant seem to figure out how to add more dynamic text fields and populate them with more <person> and <comment> attributes.
Here is my code:
function loadXML(loaded) {
if (loaded) {
_root.inventor = this.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
_root.comments = this.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue;
name_txt.text = _root.inventor;
comment_txt.text = _root.comments;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("inventors.xml");
and xml:
<?xml version="1.0"?>
<inventors>
<person>
<name>Thomas Edison</name>
<comment>Inventor of many things such as the incandescent lightbulb.</comment>
</person>
<person>
<name>Doug Engelbart</name>
<comment>Invented the mouse at the Stanford Research Institute</comment>
</person>
<name>Patrick</name>
<comment>did this xml file</comment>
</person>
</inventors>
I am trying to display Patrick - and did this xml file.
Could you please help me figure out what I am doing wrong here?
Is There Anyway To Read Data In From A Text File And Populate An Array With The Data?
hello,
i'm new to flash, and i'm trying to create a photo gallery. however, the photos may not always be the same, and i need to have a way to easily change the pictures without having to go back into flash to change the code everytime. i thought a good way to do this would be to read the names of the pictures in from a text file and then use those names to populate an array, similar to the tutorial on creating a photo gallery on kirupa.com. the problem is, i have no idea how to do this. anyone have any ideas?
thanks
Help Me Define My Search.. ( Sound Data To Graphic Data)
I don't know what the actual terminology is so my searches are tanking. What I want to do is to take an audio file and based on the tones and whatnot generate graphics that move with the music. The visualizations in Windows Media Player do exactly what I want but I don't know what it is actually called.
Any help to point me in the right direction is much appreciated.
Thanks
Scroll Bar Works For External Data But Not Internal Data
Howdy,
I have a dynamic text box named 'outputbox'. This is set for multiline. I have an associated scroll bar.
I make a lot of these kind of calls:
PHP Code:
history.onPress = function() {
outputbox._visible = true;
loader = new LoadVars();
loader.load("history.txt");
loader.onLoad = function() {
outputbox.text = this.history;
};
This works great, the scrollbar becomes active when the text goes beyond the outputboxes boarders.
In addition, this 'outputbox' also has a variable (Var) associated with it named 'myTally'. At some particular frames I am generating content for this variable thusly:
PHP Code:
for (receipt = 0; receipt<23; receipt++) {
description = _root["config"+receipt][1];
price = _root["config"+receipt][2];
if (description != 0) {
mytally = (mytally+"
" +description+" "+ price); }
}
Indeed, the outputbox certainly gets populated but the scrollbar does not work. When I select-and-drag the text it definitely goes beyond the boarders of the outputbox. If I change the font size of this outputbox (8pt to 16pt) then the scrollbar *does* work.
Why does the scrollbar react to an external file and not my dynamically generated variable? Is something not scoped or in focus? I really have no idea. Anyhow, any suggestions of where to look for resolution would be greatly appreciated.
Thanks,
Cheez
Flash Data Intergratino Useing Xml Data Bases
im not huge newbee to this , iv overcome the majority of the studid little qustions but i ask you this , how do you create adatebasse of say mp3s thru flash using a xml database. first, how do you embeed say mp3 files into a xml document and so on and so on
How To Drag Column Data From One Data Grid To The Anther?
How to drag column data from one Data Grid to the anther?
Hi,
I build an application in mx2004 and I have 2 dataGrid instants containing data.
I am looking for a way to let the user drag a row of data from a data grid and drop it in anther data grid.
I have an “EventListener” on “myListener.cellPress” caching the data, but I could not find a way to determine where to drop the data and how to insert it to the destination dataGrid.
Thank
Nimrod
Flash Sends Data To PHP, Browser Waiting For Data
Hi,
I have the following problem. I'm implementing a flash form mailer using PHP to send out the mail. I'm doing this in the actionscript to sed out the data:
_root.mcDataField.loadVariables("form.php", "POST");
Then my PHP script looks like this:
$sendTo = "xyz@server.com";
$subject = "Some title here";
$headers = "From: " . $_POST["Name"]. "<" . $_POST["Email"] . ">
";
$headers .= "Reply-To: " . $_POST["Email"] . "
";
$headers .= "Return-Path: " . $_POST["Email"];
$message = $_POST["Message"];
$retVal = mail($sendTo, $subject, $message, $headers);
When I sendthe data, it gets emailed, but the browser shows (in the bottom left corner): "Waiting for xyz.com", where xyz.com is the server I have my files on.
Any idea would be greatly appreciated! Thank you!
How To Drag Column Data From One Data Grid To The Anther?
How to drag column data from one Data Grid to the anther?
Hi,
I build an application in mx2004 and I have 2 dataGrid instants containing data.
I am looking for a way to let the user drag a row of data from a data grid and drop it in anther data grid.
I have an “EventListener” on “myListener.cellPress” caching the data, but I could not find a way to determine where to drop the data and how to insert it to the destination dataGrid.
Thank
Nimrod
MyComboBox.addItem(label [,data]) How To Add Data?
The Flash help says to add an item to a ComboBox using myComboBox.addItem(label [,data]). I have no problem adding the label but my data is two items: unit and value. How do I add these two pieces of data?
An example of a comboBox listing might be:
Label: Rope
Unit: Feet
Value: 2.00
So if a user selects Rope, they will see it's $2.00 a foot.
Thanks for any help.
Data Connection/Data Holder Comps
I do a lot of developing with SQL->PHP->XML->FLASH, and end up having to deal with a LOT of data that I both recieve and send. I really just noticed the Data Connection/Data Holder comps like...today and I dont really see how they are all that much better than just using my own array's and objects. Perhaps my limited understanding of them prohibits my appreciation. Anyone care to enlighten?
AS2: Data Bind SQL Query Data To ComboBox
Can anyone point me in the right direction - I'm using Flash remoting with CFCs and I'm trying to pull query data from SQL and populate a ComboBox with AS2 components.
I have a CFC called "states.cfm" and Flash Remoting is set up and connecting properly (AS2 components). It's pulling 2 columns from the states table, "state" and "stateValue". In the flash movie there's a dropdown with an instance name "dd_states". I've searched all over (Using Flash,macromedia,google,flashkit) and I can't find a clear example using the AS2 databinding components using data from a SQL Query....
ThxInAdv
Data Grid Versus Data Connection Kit
can anybody explain me an advantage of data connection kit
over data grid, is it realy better? there is no test version of firefly so u can not test it.
i mean does anybody used the data grid and than chaned to
firefly?is this connector-resolver stuff that usefull? is it worth 299$
thanks nermin
AS2: Data Bind SQL Query Data To ComboBox
Can anyone point me in the right direction - I'm using Flash remoting with CFCs and I'm trying to pull query data from SQL and populate a ComboBox with AS2 components.
I have a CFC called "states.cfm" and Flash Remoting is set up and connecting properly (AS2 components). It's pulling 2 columns from the states table, "state" and "stateValue". In the flash movie there's a dropdown with an instance name "dd_states". I've searched all over (Using Flash,macromedia,google,flashkit) and I can't find a clear example using the AS2 databinding components using data from a SQL Query....
ThxInAdv
Saving Data And Loading Data From A .txt File...
Hi,
I know there's a way to do it but i just couldn't get the right tutorial around..
I have read through Shared Objects but i couldn't get it work...
I just have to save my data, maybe array into .txt file and later on
retrieve from the same .txt file...
Anyone here have an example or some source code so i can have reference on it?
Thanks for the help provided....
Regards,
Lacus
AS2: Data Bind SQL Query Data To ComboBox
Can anyone point me in the right direction - I'm using Flash remoting with CFCs and I'm trying to pull query data from SQL and populate a ComboBox with AS2 components.
I have a CFC called "states.cfm" and Flash Remoting is set up and connecting properly (AS2 components). It's pulling 2 columns from the states table, "state" and "stateValue". In the flash movie there's a dropdown with an instance name "dd_states". I've searched all over (Using Flash,macromedia,google,flashkit) and I can't find a clear example using the AS2 databinding components using data from a SQL Query....
ThxInAdv
Need A Simple If/else Statement, SOSneed A Simple If/else Statement, SOS
hi, i'm a new learner.
currently, doing an exercise on button.
i want to do a navigation button like
www.fendi.com (pls refer, thx ; )
where button that onPress it will remain,
the rest not clicked, will fade out.
i think i need a right if/else statement.
i've tried few, but still not working.
i have my flash file attached.
hope some experts here can help.
hear from you guys soon, thanks
Referencing Data Vs Duplicating Data
This is a question that keeps coming up for me, but I've never been able to find an adaquate answer. I'm probably not looking in the right places.
When setting properties of an object, what exactly is being stored: the location of the property or the actual information for that property? For example, if I have the following code:
_root.createEmptyMovieClip( "mcEmpty", 0 );
tarClip = mcEmpty;
What exactly is being stored in tarClip? Is it a string denoting the location of mcEmpty or some other reference to mcEmpty?
All I know is that for some objects (ie. arrays, strings, numbers) the actual data from one object is placed in the second resulting in two instances of the same information. Yet for other objects (ie. movieclips, xml nodes) a reference to the data seems to be placed in the inheriting object such that only one copy of the data exists.
So in general, my question comes down to the following: in what instances is information duplicated when one property is set equal to another and when is a reference to the information set? Is there a general rule for this?
Thanx for any help you can provide.
How To Use Data Component To Bind Data From Sql
i'm having problem.is there any one can guide me and show me step by step to bind data from sql using data component such as data set and xml connector.I relly don't have idea how to done that.tq?
Getting Data From A Php Script That Gets Data From A Database
Hello,
I am trying to get information for a database, and the php script works fine. The php script outputs the data in flash format, and with traces the flash appears to be working fine.
The only problem is when I try to call any value out of the array, it comes back undefined, even though while going through the loop the traces said the values were in fact defined.
Here is my shortened script:
ActionScript Code:
var path = "http://localhost/rpg/web-content/";
var terrainurl = path + "getterrain.php";
terrain.load(terrainurl);
terrain.onLoad = function() {
for (var i:Number = 0; i < this.ttotal; i++) {
terid = this["tid" + i];
terrainpicture[terid] = this["terrainpicture" + i];
}
}
var terrainpicture:Array = new Array();
loadMovie(path + terrainpicture[1], _root.t1);
stop();
The last load movie returns an undefined value. I have other queries going on in the script but I commented them out. Every value comes back undefined.
Any ideas?
Thanks,
Cameron
"Embed(source" Vs. "Embed(systemFont"
Code:
package fonts {
import flash.display.Sprite;
public class Taco_Salad extends Sprite {
[Embed(source='C:/WINNT/fonts/TACOSRG_.TTF', fontName='Taco Salad',
fontStyle='italic', fontWeight='bold',
mimeType='application/x-font')]
public var wrFont:Class;
}}
If I embed a font as above accessing the ttf file directly I get an mxmlc compiler error if I use anything other than 'normal' for fontStyle and fontWeight. (thus no italic or bold.)
"Error: exception during transcoding: Font for alias 'Taco Salad' with bold weight and italic style was not found at: file:/C:/WINNT/fonts/TACOSRG_.TTF"
However no such error occurs when using the systemFont syntax:
package fonts {
import flash.display.Sprite;
public class Taco_Salad extends Sprite {
[Embed(systemFont='Taco Salad', fontName='Taco Salad', fontStyle='italic', fontWeight='bold',
mimeType='application/x-font')]
public var wrFont:Class;
}
}
However, the same ttf file in the font directory is being accessed presumably.
The thing is, I need to use the "Embed(source" version because I have some ttf files that are not registered with windows, and there are slight differences in how Flex/AS3 renders fonts embeded from source ttf files vs as Windows systemFonts.
But anyway, why no italic or bold when embedding with the "source" syntax.
Thanks.
List Item W/ Multiple Data Items - How To Select Data Items?
I have a list component (myListBox) that is showing the labels for some data items read in from an XML file. Each item in the list has an associated name, description, and path (they're mp3 files) and they are named accordingly in the XML tags.
Using myListBox.selectedItem.label gives the correct label but myListBox.selectedItem.data is undefined. I've tried using the XML tags after the data selector (e.g. myListBox.selectedItem.data.path) but those don't work, either. All of the examples I've found in the docs show only a single data element associated with each list item.
So, if a list item has multiple data items associated with it, how do you select them using the listBox.selectedItem property?
TIA,
rgames
Data In Data Out In Flash MX
Can anyone help me with this. How can I pull data into flash a flash ap? Like quarry data from a database to change text in flash. For example, if I was to work on a bracket for a tournament, I would want to quarry the teams in the tournament from a database and have them appear in the ap.
Any clue on how to do that?
thanks!
How Do Get Data From Data Binding
I have an XMLConnector attached to a xml file and bound to a label. This is working fine.
My question is:
How do I access the values in either the label or the XMLConnector through actionscript. Whatever I try returns null for the value.
import mx.data.binding.*;
var dataTypeObj:mx.data.binding.DataType = this.xmlConn.getField("results", "rack.positions");
var test = dataTypeObj.getAsNumber();
Link In Xml Data To Other Xml Data
Hi,
Boy, I'm not even sure I can describe this; I get dizzy.
Picture a dictionary project.
I start with an xml file containing terms and definitions.
My movie creates a list of the terms.
When rolling over a term, the definition appears.
So far so good.
Now some of the definitions contain other terms that appear in the list.
I would like to be able to mouseover the words in the definition that are also in the list and have the definition from the xml file appear as a sort of tooltip.
For instance, animal and cat are terms in the list.
I rollover cat and the definition appears in a dynamic textbox to the left of the list. The definition is: A cat is an animal. I'd like to rollover the word animal and have the definition of animal appear as a tooltip.
See why I get dizzy?
Is this possible,
Thanks a bunch,
Debbie
AS2 - Data Set Not Storng Any Data?
Maybe I am a bit dense, but I have been trying to make this work all day and I can't get it to, so I would kindly request some assistance.
Basically what I am trying to do is to read data from a database containing a number of products and showing them on the stage.
Of course it is a work in progress and I have a lot of lines commented for later implementations, still the problem I am facing here that the data loaded in the first part of the code fails to show up later when I try to retrieve it via the _root.datacontainer.items[j].xxx method. All I get is a number of "undefined" on the screen.
Where am I going wrong? Any help is appreciated.
Code:
directory="public/";
lista=new LoadVars();
lista.load("http://www.agricolabaldi.com/tuttiProdotti.php");
lista.onLoad=function(success){
function carica(){
i = 0;
var totale=lista.t;
var elenco:Array=new Array();
for (i=0; i<(lista.t); i++){
elenco.push({
id:lista["id"+i],
nome:lista["nome"+i],
descrizione:lista["descrizione"+i],
nomeFoto:directory+lista["nomeFoto"+i],
novita:lista["novita"+i],
tipologia:lista["tipologia"+i],
confezionamento:lista["confezionamento"+i]
});
}
_root.datacontainer.dataProvider=elenco;
}
carica();
}
var thumbWidth:Number = 120;
var thumbHeight:Number = 75;
var MainTL:MovieClip = this;
var selected_thumb:MovieClip;
var thumbs:Array = new Array();
var thumbMCLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
thumbMCLoader.addListener(listener);
initThumbScroller();
function initThumbScroller(targetBtn:MovieClip, workCategoryID:String){
var counter:Number = 0;
for(var j:Number=0;j<20;j++){
var thumb = MainTL.thumb.duplicateMovieClip("thumb"+counter,counter);
thumb.thumb_title_mc._visible = false;
if (j==0){
xbase = 5;
ybase = 5;
thumb._x=xbase;
thumb._y=ybase;
} else {
if (xbase == 505){
xbase = 5;
ybase = ybase + 110;
thumb._x=xbase;
thumb._y=ybase;
} else {
xbase = xbase+ 125;
thumb._x=xbase;
thumb._y=ybase;
}
}
thumb.ID = counter;
thumb.title = _root.datacontainer.items[j].nome;
thumb.pictureURL = _root.datacontainer.items[j].nomeFoto;
counter++;
thumb.titleInitializing = true;
thumb.title_mc._visible = true;
thumb.title_mc._width = thumbWidth;
thumb.title_mc.theTitle.multiline = true;
thumb.title_mc.theTitle.wordWrap = true;
thumb.title_mc.theTitle.autoSize = true;
thumb.title_mc.theTitle.text = _root.datacontainer.items[j].nome;
thumb.title_mc._x = 0+Math.round((thumb.holder._width-thumb.title_mc._width)/2);
var thumbMCLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
thumbMCLoader.addListener(listener);
thumbMCLoader.loadClip(_root.datacontainer.items[j].nomeFoto,thumb.holder.thumb);
listener.onLoadComplete = function(target:MovieClip){
target._parent.preloader._visible = false;
}
listener.onLoadInit = function(target:MovieClip){
target._width = thumbWidth;
target._height = thumbHeight;
var tempMC = target._parent._parent.createEmptyMovieClip("tempSwapMC",target._parent._parent.getNextHighestDepth());
target._parent._parent.title_mc.swapDepths(tempMC);
}
thumb.holder.onRollOver = Delegate.create(MainTL,onThumbnailOver,thumb);
thumb.holder.onRollOut = thumb.holder.onDragOut = Delegate.create(MainTL,onThumbnailOut,thumb);
thumb.holder.onRelease = Delegate.create(MainTL,onThumbnailClick,thumb);
thumbs.push(thumb);
}
MainTL.thumb._visible = false;
}
function onThumbnailOver(thumb:MovieClip){
setSelectedThumb(thumb);
}
function onThumbnailClick(thumb:MovieClip){
//if( site_xml.firstChild.childNodes[thumb.ID].attributes.link != undefined ){
//_global.mcwidth = site_xml.firstChild.childNodes[thumb.ID].attributes.mcwidth;
//_global.mcheight = site_xml.firstChild.childNodes[thumb.ID].attributes.mcheight;
//_global.picname = site_xml.firstChild.childNodes[thumb.ID].attributes.link;
//win = PopUpManager.createPopUp(_root, Window, true, {closeButton:true});
//win.title=" Azienda Agricola Baldi Paolo";
//win.contentPath=('showpic.swf');
//win.setSize(mcwidth,mcheight);
//var alto:Number = ((Stage.width-mcwidth)/2);
//var destra:Number = ((Stage.height-mcheight)/2);
//win._x = alto;
//win._y = destra;
//lo = new Object();
//lo.click = function(){
//win.deletePopUp();
//}
//win.addEventListener("click", lo)
//}
}
function setSelectedThumb(thumb:MovieClip):Void{
selected_thumb = thumb;
}
function getSelectedThumb():MovieClip{
return selected_thumb;
}
How To Embed An Swf Into A Php Doc?
I need to know if there's a way to embed an swf directly into a php document without using html tags like embed.
I need NOT to use the following:
__________________________________________________ _____
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=550 HEIGHT=400>
<PARAM NAME=movie VALUE="LoadVarsTest.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src="LoadVarsTest.swf" quality=high bgcolor=#000000 WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
<?php
// Process the OUTPUT options
// FLASH DATA CREATED HERE
if ($action == "VIEW")
{
echo ("TextEffectToLoad" . "=" . "$TextEffect" );
echo ("&");
}
?>
</body>
</html>
________________
I need to use ONLY php tags.
Anybody?
Embed... Or SOMEthing...
does anyone know if you can call a .swf from within another .swf file? what i mean is, i want to have one .swf file playing, and then have it call another .swf file, embedding it somewhere within the original .swf file. so i'd have one going - say full screen, then within that one, have another one playing... kinda like a little window within the larger swf... thanks!
I Need Embed Help
I am in search of a good tutorial about embeding flash movies in an html page. What exactly I am trying to make is a sample page for individual flash movies....accessible from an html text. So say you go to a page that is a html page and it is called Samples then there would be numbers 1 thru 10 and you click on one and with the samples page still open the movie opens in another window....this is what I am trying to create....Can someone please help!!! Thank you, Wayne
I Need Embed Help Please
I am in search of a good tutorial about embeding flash movies in an html page. What exactly I am trying to make is a sample page for individual flash movies....accessible from an html text. So say you go to a page that is a html page and it is called Samples then there would be numbers 1 thru 10 and you click on one and with the samples page still open the movie opens in another window....this is what I am trying to create....Can someone please help!!! Thank you, Wayne
Embed
OK, thanks, got it to work, phew. I went into the Library, embedded the font there and then linked it and that seemed to have done the trick.
Help Me Embed An Swf
Be kind to the newbie and help me embed a swf in my html page. In Dreamweaver, I inserted an swf file, but when I preview it in a browser it only plays in Netscape, not IE. (I read the post about a JavaScript workaround for an IE issue similar to this, but I have to confess, I don't know JS and when I tried to follow along things got ugly!) Can anyone help me out?? TIA!
Embed Swf In PHP
I have tried inserting the same ole html tags into a php doc to call on a swf without success. I have read several variations on how to do this using Java etc. Does anyone have any alternative examples or recommendations on how and or "if" this can be done?
Much appreciated
|