Need Help with XML Parsing on to DataGrid
Hi
I have retrivied this Data into my HttpService Result function .
<list>
<User>
<ename>JAMES</ename>
<empno>7900</empno>
</User>
<User>
<ename>FORD</ename>
<empno>7902</empno>
</User>
<User>
<ename>MILLER</ename>
<empno>7934</empno>
</User>
</list>
[Bindable]
private var xmldata:XML;
private function resultHandler(event:ResultEvent):void{
xmldata=event.result as XML;
<mx:DataGrid x="50" y="23" width="469" height="265" dataProvider="{xmldata.User}">
<mx:columns>
<mx:DataGridColumn headerText="Type" dataField="ename"/>
<mx:DataGridColumn headerText="Sales" dataField="empno"/>
</mx:columns>
</mx:DataGrid>
But this is not displaying any data into DataGrid .
Could anybody please help me .
Thanks .
after you get data assign the data to the data grid
datagrid.dataprovider = xml;
and also do datagrid.invalidateList() after u get the data if the above line does not help
also see if the data provider is not null if nothing helped.
Similar Messages
-
I need help with XML Gallery Fade in out transition. somebody please help me :(
I need help with XML Gallery Fade in out transition. somebody please help me
I have my post dont want to duplicate itThe problem doesn't lie with your feed, although it does contain an error - you have given a non-existent sub-category. You need to stick to the categories and sub-categories listed here:
http://www.apple.com/itunes/podcasts/specs.html#categories
Subscribing to your feed from the iTunes Store page work as such, but the episodes throw up an error message. The problem lies with your episode media files: you are trying to stream them. Pasting the URL into a browser produces a download (where it should play the file) of a small file which does not play and in fact is a text file containing (in the case of ep.2) this:
[Reference]
Ref1=http://stream.riverratdoc.com/RiverratDoc/episode2.mp3?MSWMExt=.asf
Ref2=http://70.33.177.247:80/RiverratDoc/episode2.mp3?MSWMExt=.asf
You must provide a direct link to the actual mp3 file. Streaming won't work. The test is that if you paste the URL of the media file (as given in the feed) into the address bar of a browser it should play the file. -
Need help with XML transformation
I am not sure this is the right place for this. But i will try it here. I am very troubled with my XSLT. Trying to transform a text Coupon which has the following html for it. So,
_1. INPUT is:_
<html>
<head>
</head>
<body>
<p>
This coupon is for a good guy whose first name is :
</p>
<p>
</p>
<p align="center">
Sadd
</p>
<p align="center">
</p>
<p align="right">
<b>also</b> whose <var>full_name</var> is Sadd Hossain
</p>
<p align="left">
</p>
<p align="left">
He is a <font size="3">software </font><font size="4">engineer for</font><font size="5">
S&H</font>
</p>
</body>
</html>
*2. output needed is:*
<?xml version="1.0" encoding="UTF-8"?>
<POSMESSAGE>
<TextMSG >
This coupon is for a good guy whose first name is :
</TextMSG>
<TextMSG >
</TextMSG>
<TextMSG align="center">
<emph>SADD</emph>
</TextMSG>
<TextMSG >
</TextMSG>
<TextMSG align="right" >
also whose full_name is Sadd Hossain
</TextMSG>
<TextMSG>
</TextMSG>
<TextMSG align="left" >
He is a software engineer
for S&H
</TextMSG>
</POSMESSAGE>
*3. XSLT for this*
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="body">
<POSMESSAGE>
<xsl:for-each select="p">
<TextMSG>
<!--xsl:if test="not[@align='']"-->
<xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute>
<!--/xsl:if-->
<xsl:attribute name="font"><xsl:value-of select="@size"/></xsl:attribute>
<xsl:value-of select="."/>
</TextMSG>
<xsl:for-each select="b">
<emph>
<xsl:value-of select="."/>
</emph>
</xsl:for-each>
</xsl:for-each>
</POSMESSAGE>
</xsl:template>
</xsl:stylesheet>
*4: the above xslt generating this output*
<?xml version="1.0" encoding="UTF-8"?>
<POSMESSAGE><TextMSG align="" font="">
This coupon is for a good guy whose first name is :
</TextMSG><TextMSG align="" font="">
</TextMSG><TextMSG align="center" font="">
SADD
</TextMSG><TextMSG align="center" font="">
</TextMSG><TextMSG align="right" font="">
also whose full_name is Sadd Hossain
</TextMSG><TextMSG align="left" font="">
</TextMSG><TextMSG align="left" font="">
He is a software engineer
for S&H
</
*5: Need help with this. what should my xslt look like to get the desired output???????????????*
any help or direction will be very much appreciated. Thank you_I have below suggestions:
1. Please use code option given in message editor toolbar for posting any formatted content like XML, Java code snippet etc.
2. replace & in your source XML with _& a m p ;_ (Without spaces, I have put spaces to make it visible here).
3. I have modified your XSLT according output XML you have given. I am not sure what you want to do with some elements like <b>, <font>, <var> etc. change below XSLT as you require for these elements.
Modified XSLT:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="body">
<POSMESSAGE>
<xsl:for-each select="p">
<TextMSG>
<xsl:if test=". != ''">
<xsl:for-each select="@align">
<xsl:attribute name="align">
<xsl:value-of select="."></xsl:value-of>
</xsl:attribute>
</xsl:for-each>
<xsl:value-of select="."/>
</xsl:if>
</TextMSG>
</xsl:for-each>
</POSMESSAGE>
</xsl:template>
</xsl:stylesheet>
OUTPUT:
<?xml version="1.0"?>
<POSMESSAGE>
<TextMSG>This coupon is for a good guy whose first name is :</TextMSG>
<TextMSG/>
<TextMSG align="center">Sadd</TextMSG>
<TextMSG/>
<TextMSG align="right">alsowhose full_name is Sadd Hossain</TextMSG>
<TextMSG/>
<TextMSG align="left">He is a softwareengineer forS&H</TextMSG>
</POSMESSAGE> -
Need help with XML delay URGENT!!!
Hi i need help making a flash movie to load everything from
xml. It has to load text, images and flv, but, it has to load them
and end them at the time said in the xml. So flash loads and
unloade the text or image or video at the time specified in the
XML! PLEASE HELP I NEED THIS DONE TODAY!!!!! VERY IMPORTANT!!!
Contact me by msn [email protected] or send mail or
reply here!!It was probably a little unclear initially (no offence
intended ) whether your problem was with getting the data from XML
or with the sequencing aspect. I assume that its the sequencing
aspect based on your recent reply.
So if it was me I would parse the loaded info into Date
objects for the load and remove times and have this information
handled by some sort of sequencing code.
At its simplest, you could compare the xml-derived date/times
for load/unload with the current system date/time and use a
setInterval function to initiate the load after the calculated
difference in milliseconds has passed. Similar for the removeclip
timing. -
Hello, I would like to create an extention that will help to
manage a
glossary.
First I need to decide on the structure of the xml document
that will
contain all glossary entries. Since I don't have much
experience with XML in
extention content, I was wondering if there are certain
recommendations I
should follow.
What is preferable: using attributes that will holt the
content or rather
having xml-elements. What is easy to parce?
I would greatly appreciate any tips, help and suggestions.
Olyalyu.oO(olga)
>First I need to decide on the structure of the xml
document that will
>contain all glossary entries. Since I don't have much
experience with XML in
>extention content, I was wondering if there are certain
recommendations I
>should follow.
I would start as simple as possible, for example with
something like
this:
<glossary>
<entry>
<term>...</term>
<explanation>...</explanation>
</entry>
<entry>
<term>...</term>
<explanation>...</explanation>
</entry>
</glossary>
Of course it also depends on what you want to do with this
structure and
if you need additional informations.
>What is preferable: using attributes that will holt the
content or rather
>having xml-elements. What is easy to parce?
There's no real rule-of-thumb whether to use elements or
attributes.
If unsure, use elements.
Micha -
it 's 10g
set serveroutput on
set line 2000
drop table emp;
CREATE TABLE EMP (
EMPNO NUMBER(10),
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7, 2),
COMM NUMBER(7, 2),
DEPTNO NUMBER(2));
DECLARE
l_bfile BFILE;
l_clob CLOB;
l_parser dbms_xmlparser.Parser;
l_doc dbms_xmldom.DOMDocument;
l_nl dbms_xmldom.DOMNodeList;
l_n dbms_xmldom.DOMNode;
l_temp VARCHAR2(1000);
TYPE tab_type IS TABLE OF emp%ROWTYPE;
t_tab tab_type := tab_type();
BEGIN
l_bfile := BFileName('ADMIN1_DIR', 'emp.xml');
dbms_lob.createtemporary(l_clob, cache=>FALSE);
dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
dbms_lob.loadFromFile(dest_lob => l_clob,
src_lob => l_bfile,
amount => dbms_lob.getLength(l_bfile));
dbms_lob.close(l_bfile);
-- make sure implicit date conversions are performed correctly
dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY''');
-- Create a parser.
l_parser := dbms_xmlparser.newParser;
-- Parse the document and create a new DOM document.
dbms_xmlparser.parseClob(l_parser, l_clob);
l_doc := dbms_xmlparser.getDocument(l_parser);
-- Free resources associated with the CLOB and Parser now they are no longer needed.
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
-- Get a list of all the EMP nodes in the document using the XPATH syntax.
--l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/EMPLOYEES/EMP');
l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/ipdrIPDR');
-- Loop through the list and create a new record in a tble collection
-- for each EMP record.
FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
l_n := dbms_xmldom.item(l_nl, cur_emp);
t_tab.extend;
-- Use XPATH syntax to assign values to he elements of the collection.
-- dbms_xslprocessor.valueOf(l_n,'recordId/text()',t_tab(t_tab.last).empno);
dbms_xslprocessor.valueOf(l_n,'recordId/text()',t_tab(t_tab.last).ename);
dbms_xslprocessor.valueOf(l_n,'JOB/text()',t_tab(t_tab.last).job);
dbms_xslprocessor.valueOf(l_n,'MGR/text()',t_tab(t_tab.last).mgr);
dbms_xslprocessor.valueOf(l_n,'HIREDATE/text()',t_tab(t_tab.last).hiredate);
dbms_xslprocessor.valueOf(l_n,'SAL/text()',t_tab(t_tab.last).sal);
dbms_xslprocessor.valueOf(l_n,'COMM/text()',t_tab(t_tab.last).comm);
dbms_xslprocessor.valueOf(l_n,'DEPTNO/text()',t_tab(t_tab.last).deptno);
END LOOP;
-- Insert data into the real EMP table from the table collection.
-- Form better performance multiple collections should be used to allow
-- bulk binding using the FORALL construct but this would make the code
-- too long-winded for this example.
FOR cur_emp IN t_tab.first .. t_tab.last LOOP
INSERT INTO emp
ename
VALUES
t_tab(cur_emp).ename
END LOOP;
COMMIT;
-- Free any resources associated with the document now it
-- is no longer needed.
dbms_xmldom.freeDocument(l_doc);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('errrrrrrrr--->'||sqlerrm);
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
dbms_xmldom.freeDocument(l_doc);
END;
/select * from emp;
this file works fine
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ipdrIPDR>
<recordId>923622</recordId>
</ipdrIPDR>
but this is not . .. note my special charter in the tokens... i did change in the program too but does not work ...
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ipdr:IPDR>
<recordId>923622</recordId>
</ipdr:IPDR>
I get error
errrrrrrrr--->ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00234: namespace prefix "ipdr" is not declared
Error at line 2
PL/SQL procedure successfully completed.Hi,
Yes, I have tried the same method. will be ok.
But I have got another some records on the same column as follows.
I have tried with another one xmltable with outer join(+), still not getting the actual data (null record from the original(main) table) and extra records from the new xmltable.
Is it possible to make one or union with xmltable also can we check the node either /Item or /section exists something like that
<?xml version="1.0" encoding="WINDOWS-1252"?>
<section>
<sectionmetadata>
<object_id>317832</object_id>
<asitype>Section</asitype>
<instructornotes/>
</sectionmetadata>
<selection_ordering>
<selection seltype="All">
<selection_number>1</selection_number>
<or_selection>
<selection_metadata mdoperator="EQ" mdname="questionid">_155451_1</selection_metadata>
</or_selection>
</selection>
<selection seltype="All">
<or_selection>
<selection_param pname="singleLink">true</selection_param>
</or_selection>
</selection>
</selection_ordering>
</section>Thanks, -
This is my xml code file.
<?xml version="1.0" encoding="iso-8859-1"?>
<contato_lista xmlns="includes:net_schema.xml">
<contato ID="001">
<nome>Andr�teste</nome>
<ip>192.168.25.242</ip>
</contato>
<contato ID="002">
<nome>Gustavo</nome>
<ip>192.168.25.72</ip>
</contato>
</contato_lista>
I am trying to get the text from the tags <nome> and <ip> from the 2 tags <contato>. And this is the method I am using. I am trying to get the text in the tags <nome> in the array contatos_lista[], everytime I run the program I get empty. Please I need help. I am desperade.
Thanks in advace.
public String[] importaContatos() {
String contatos_lista[] = new String[ 12 ];
contatos_lista[0] = "N�o h� contatos";
Node nodeContato;
NodeList contatoChild;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
File contatos = new File("D:/userdir/mycodes/NetMessage/contatos.xml");
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse( contatos );
}catch (SAXParseException spe) {
}catch (ParserConfigurationException e){
}catch(SAXException e){
}catch (IOException e){
Node nodeElement = document.getDocumentElement();
Node nodeChild = nodeElement.getParentNode();
Node nodeContatoLista = nodeChild;
NodeList contatoListaChild = nodeContatoLista.getChildNodes();
//JOptionPane.showMessageDialog(null , contatos_lista[0]);
for (int i = 0; i <= contatoListaChild.getLength(); i++){
nodeContato = nodeContatoLista.getFirstChild();
nodeContato = nodeChild.getNextSibling();
contatoChild = nodeContato.getChildNodes();
int count = 0;
for (int y = 0; y < contatoChild.getLength(); y++){
contatos_lista[count] = contatoChild.item(y).getNodeValue();
count++;
return contatos_lista;
}This is my xml code file.
<?xml version="1.0" encoding="iso-8859-1"?>
<contato_lista xmlns="includes:net_schema.xml">
<contato ID="001">
<nome>Andr�teste</nome>
<ip>192.168.25.242</ip>
</contato>
<contato ID="002">
<nome>Gustavo</nome>
<ip>192.168.25.72</ip>
</contato>
</contato_lista>
I am trying to get the text from the tags <nome> and
<ip> from the 2 tags <contato>. And this is the method
I am using. I am trying to get the text in the tags
<nome> in the array contatos_lista[], everytime I run
the program I get empty. Please I need help. I am
desperade.
Thanks in advace.
public String[] importaContatos() {
String contatos_lista[] = new String[ 12 ];
contatos_lista[0] = "N�o h� contatos";
Node nodeContato;
NodeList contatoChild;
DocumentBuilderFactory factory =
ctory = DocumentBuilderFactory.newInstance();
try {
File contatos = new
tatos = new
File("D:/userdir/mycodes/NetMessage/contatos.xml");
DocumentBuilder builder =
r builder = factory.newDocumentBuilder();
document = builder.parse( contatos );
}catch (SAXParseException spe) {
}catch (ParserConfigurationException e){
}catch(SAXException e){
}catch (IOException e){
Node nodeElement =
ement = document.getDocumentElement();
Node nodeChild = nodeElement.getParentNode();
Node nodeContatoLista = nodeChild;
NodeList contatoListaChild =
Child = nodeContatoLista.getChildNodes();
//JOptionPane.showMessageDialog(null ,
(null , contatos_lista[0]);
for (int i = 0; i <=
0; i <= contatoListaChild.getLength(); i++){
nodeContato =
deContato = nodeContatoLista.getFirstChild();
nodeContato = nodeChild.getNextSibling();
contatoChild =
tatoChild = nodeContato.getChildNodes();
int count = 0;
for (int y = 0; y <
y = 0; y < contatoChild.getLength(); y++){
contatos_lista[count] =
atos_lista[count] =
contatoChild.item(y).getNodeValue();
count++;
return contatos_lista;
}This line appears to be wrong to me
Node nodeChild = nodeElement.getParentNode();
Why are you doing that?
Anyway it would be easier just to do
ement = document.getDocumentElement();
NodeList contatoListaChild = ement.getElementsByTagName("contato");
for (int i = 0; i <= contatoListaChild.getLength(); i++){
Element contato = contatoListaChild.item(i); -
Need help with xml video gallery
Hello everyone
I recently bought a xml video gallery. I'm loading the movie externally into another movie. When the xml gallery loads, it cancels all sounds.
I need to figure out where in the actionscription can i reverse the cancellation of sounds. Can anyone help? if possible, I can email, whomever is willing to help, the xml gallery to see if theres another reason the sound is being canceled.
Also, the sound of the gallery doesn't work til you click the volume scroller.
Here are two parts of actionscript included in the gallery:
part one:
// Import filter classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
// Set flash variables
var xmlFileUrl:String = "playlist.xml";
var auto_play:String = "true";
// Set xml file URL
if (_root.xmlfile) {
xmlFileUrl = _root.xmlfile;
var V_SRC;
var thuArray:Array = new Array();
var currentVideo:Number = 0;
var totalItems;
var numOfItems:Number;
var itemDistance:Number = 120+5;
var itemHeight:Number = 80+2;
var Value:Number = 1;
var boundry:Number = 1;
var ratio:Number = 1;
var diff:Number = 1;
var collectionWidth:Number = 1;
var buffer:Number = 135*2;
this.createEmptyMovieClip("video_txt",this.getNextHighestDepth());
video_txt.createTextField("theText",video_txt.getNextHighestDepth(),0,0,584,36);
video_txt.theText.selectable = false;
video_txt.theText.autoSize = "left";
//The Format
myFormat = new TextFormat();
myFormat.font = _root.font_format;
myFormat.size = _root.font_size;
myFormat.color = _root.font_color;
myFormat.align = "center";
video_txt.theText.setNewTextFormat(myFormat);
// Create a new movieclip to load the thumbs
var thumbLoader:MovieClipLoader = new MovieClipLoader();
var thumbListener:Object = new Object();
thumbLoader.addListener(thumbListener);
thumbListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number)
new Tween(target_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
target_mc._parent.preloader_mc._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = xmlLoaded;
xml.load(xmlFileUrl);
// Load the xml file into the player
function xmlLoaded(b:Boolean) {
if (b) {
auto_play = this.firstChild.firstChild.attributes.auto_play;
scrollSpeed = parseInt(this.firstChild.firstChild.attributes.scrollSpeed);
totalItems = this.firstChild.firstChild.childNodes;
numOfItems = totalItems.length;
for (j=0; j<numOfItems; j++) {
var i = player_mc.main_mc.collection_mc.attachMovie("mc_Thumb", "thumb_"+j, j);
i._x = itemDistance*j;
thumbLoader.loadClip(totalItems[j].attributes.thumb,i.loader_mc);
i.id = j;
i.videoTitle = totalItems[j].attributes.title;
i.videoUrl = totalItems[j].attributes.src;
// Create an event for thumb rollover
i.onRollOver = iRoll;
i.onRollOut = i.onReleaseOutside=iOut;
i.onRelease = iRelease;
thuArray[j] = i;
// default first video
collectionWidth = player_mc.main_mc.collection_mc._width;
currentVideo = 0;
V_SRC = thuArray[0].videoUrl;
changeVideo();
//scope._alpha = 100;
new Tween(scope, "_alpha", Regular.easeOut, 0, 100, 0.5, true);
else
trace("Error! xml file not loaded");
// onRollOver Events
function iRoll() {
player_mc.mc_title.title_txt.htmlText = totalItems[this.id].attributes.title;
this.light_mc.play();
function iRelease() {
currentVideo = this.id;
changeVideo();
function changeVideo() {
V_SRC = thuArray[currentVideo].videoUrl;
player_mc.loadVideo();
currentThumb();
player_mc.mc_title.title_txt.htmlText = thuArray[currentVideo].videoTitle;
video_txt.theText.text = totalItems[currentVideo].attributes.title;
player_mc.so.getVolume();
player_mc.playStatus = 1;
player_mc.checkStatus();
function nextVideo() {
if (currentVideo<(numOfItems-1)) {
currentVideo++;
} else {
currentVideo = 0;
changeVideo();
function currentThumb() {
for (i=0; i<thuArray.length; i++) {
if (i == currentVideo) {
thuArray[i].enabled = true;
// Mouse movement on rollover
this.onMouseMove = function() {
collectionWidth = player_mc.main_mc.collection_mc._width;
boundry = player_mc.main_mc.area_mc._width;
if ((player_mc.main_mc._ymouse>0) && (player_mc.main_mc._ymouse<itemHeight)) {
if ((player_mc.main_mc._xmouse>0) && (player_mc.main_mc._xmouse<boundry)) {
ratio = player_mc.main_mc._xmouse/boundry;
diff = (collectionWidth-boundry)+buffer;
Value = Math.floor((-ratio)*diff)+(buffer/2);
updateAfterEvent();
this.onEnterFrame = function() {
// Define movement area and speed
if (player_mc.main_mc.collection_mc._width>player_mc.main_mc.area_mc._width) {
player_mc.main_mc.collection_mc._x = Math.round((player_mc.main_mc.collection_mc._x)+((Value-player_mc.main_mc.collection_mc._ x)/scrollSpeed));
if (player_mc.main_mc.collection_mc._x>0) {
player_mc.main_mc.collection_mc._x = 0;
} else if (player_mc.main_mc.collection_mc._x<(player_mc.main_mc.area_mc._width-(player_mc.main_mc. collection_mc._width))) {
player_mc.main_mc.collection_mc._x = Math.round(player_mc.main_mc.area_mc._width-(player_mc.main_mc.collection_mc._width));
} else {
player_mc.main_mc.collection_mc._x = 0;
updateAfterEvent();
part two:
// Define flash variables
var video_url:String = "";
var tempx:Number = this._parent._x;
var tempy:Number = this._parent._y;
var timeCounter:Number = 0;
var timeInSeconds:Number = _root.time_counter;
// Object to listen to onStage Event
videoObj = vid.videoObj;
// Setting up the connection
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
// Buffer time
ns.setBufferTime (10);
videoObj.attachVideo (ns);
function loadVideo () {
video_url = _parent.V_SRC;
trace(video_url);
ns.play (video_url);
function checkStatus()
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("pause");
mc_playAgain._visible = false;
thumbs_out = false;
title_out = false;
else
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
} // end else if
if (so.getVolume() == 0)
controls_mc.mute_mc.gotoAndStop("mute");
else
controls_mc.mute_mc.gotoAndStop("on");
}; // End of the function
mc_playAgain._visible = false;
// Check Status of video
ns.onStatus = function (info)
if (info.code == "NetStream.Buffer.Empty")
mc_buffer._visible = true;
else if (info.code == "NetStream.Buffer.Full")
mc_buffer._visible = false;
else if (info.code == "NetStream.Play.Stop")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
else
trace;
} // end else if
mc_playAgain._visible = true;
mc_buffer._visible = false;
thumbs_out = true;
title_out = true;
checkStatus();
} // end else if
// Get info about video
ns.onMetaData = function(infoObject:Object)
FLVduration = infoObject["duration"];
relationshipW = infoObject.height / infoObject.width;
relationshipH = infoObject.width / infoObject.height;
if (Stage["displayState"] == "fullScreen")
largeSize ();
else
regularSize ();
if (_parent.auto_play == "false")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
mc_buffer._visible = false;
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
thumbs_out = true;
title_out = true;
_parent.auto_play = "true";
}// end else if
var videoInterval = setInterval(videoStatus, 100);
var amountLoaded;
var duration;
// videoStatus on load Event
function videoStatus()
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
controls_mc.mc_progress.mc_buff._width = amountLoaded * 250;
controls_mc.mc_progress.mc_played._x = ns.time / duration * 250;
controls_mc.mc_progress.mc_played._xscale = Math.round(ns.time*100/FLVduration);
}; // End of the function
function scrubIt()
ns.seek(Math.floor(controls_mc.mc_progress.mc_played._x / 250 * duration));
}; // End of the function
// video time
var time_interval:Number = setInterval(checkTime, 500, ns);
function checkTime(ns:NetStream) {
//current time
var ns_seconds:Number = ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
sec = seconds;
min = minutes;
if (sec<10) {
sec = "0"+sec;
if (min<10) {
min = "0"+min;
controls_mc.time_txt.time_1.text = min+":"+sec;
//total time
var minutes2:Number = Math.floor(FLVduration/60);
var seconds2 = Math.floor(FLVduration%60);
sec2 = seconds2;
min2 = minutes2;
if (sec2<10) {
sec2 = "0"+sec2;
if (min2<10) {
min2 = "0"+min2;
controls_mc.time_txt.time_2.text = min2+":"+sec2;
if (controls_mc.time_txt.time_2.text == "NaN:NaN") {
controls_mc.time_txt.time_2.text = "00:00";
setStage ();
// Object to listen onStage Event
var stageL:Object = new Object ();
// function respnsible for content alignment
function setStage ()
if (Stage["displayState"] == "fullScreen") {
tempx = this._parent._x;
tempy = this._parent._y;
this._parent._x = 0;
this._parent._y = 0;
vidBg_mc._x = 0;
vidBg_mc._y = 0;
mc_title._x = 0;
mc_title._y = -30;
slide_me._x = 0;
slide_me._y = 0;
vidBg_mc._width = Stage.width;
vidBg_mc._height = Stage.height;
mc_title._width = Stage.width;
mc_title._height = Stage.height / 20;
slide_me._width = Stage.width;
slide_me._height = Stage.height / 20;
vid._x = vid._y = 0;
largeSize ();
controls_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));
controls_mc._y = Math.round (Stage.height - 36);
mc_playAgain._x = Math.round ((Stage.width / 2) - (mc_playAgain._width / 2));
mc_playAgain._y = Math.round (Stage.height - 572);
thumbs_mc._x = Math.round ((Stage.width / 2) - (thumbs_mc._width / 2));
thumbs_mc._y = Math.round (Stage.height - 115);
main_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));;
hide_mc.onEnterFrame = function () {
timeCounter = timeCounter + 1;
if (timeCounter >= timeInSeconds * 30) {
timeCounter = 0;
controls_mc._alpha = 0;
this.onMouseMove = function () {
timeCounter = 0;
controls_mc._alpha = 100;
else
delete hide_mc.onEnterFrame;
delete this.onMouseMove;
controls_mc._alpha = 100;
this._parent._x = tempx;
this._parent._y = tempy;
vidBg_mc._width = 600;
vidBg_mc._height = 360;
mc_title._width = 600;
mc_title._height = 30;
slide_me._width = 600;
slide_me._height = 30;
vidBg_mc._x = vid._x = 0;
vidBg_mc._y = vid._y = 35;
mc_title._x = vid._x = 0;
mc_title._y = vid._x = -30;
slide_me._x = vid._x = 0;
slide_me._y = vid._y = 35;
regularSize ();
controls_mc._x = 0;
controls_mc._y = 395;
mc_playAgain._x = 243;
mc_playAgain._y = 158;
thumbs_mc._x = 0;
thumbs_mc._y = 316;
main_mc._x = 0;
main_mc._y = 406;
mc_buffer._x = Math.round (vidBg_mc._x + (vidBg_mc._width / 2));
mc_buffer._y = Math.round (vidBg_mc._y + (vidBg_mc._height / 2));
// to apply when stage (browser window) is resized or modified
stageL.onResize = function () {
setStage ();
// attaching object to the stage
Stage.addListener (stageL);
MovieClip.prototype.slide = function(yPos) {
this._y -= (this._y-yPos)/5;
// tilte actions
mc_title.onEnterFrame = function()
if (Stage["displayState"] == "normal" && title_out == false)
this.slide(5);
else if (Stage["displayState"] == "normal" && title_out == true)
this.slide(35);
if (Stage["displayState"] == "fullScreen" && title_out == false)
this._y -= (this._y+106)/5;
else if (Stage["displayState"] == "fullScreen" && title_out == true)
this.slide(0);
// thumbs actions
main_mc.onEnterFrame = function()
if (Stage["displayState"] == "normal" && thumbs_out == false)
this.slide(406);
else if (Stage["displayState"] == "normal" && thumbs_out == true)
this.slide(299);
if (Stage["displayState"] == "fullScreen" && thumbs_out == false)
this._y = Math.round (Stage.height - 0);
else if (Stage["displayState"] == "fullScreen" && thumbs_out == true)
this._y = Math.round (Stage.height - 133);
// Playlist button
controls_mc.playlist_mc.onRollOver = function ()
this.gotoAndStop("playlistOver");
controls_mc.playlist_mc.onRollOut = controls_mc.playlist_mc.onReleaseOutside = function ()
this.gotoAndStop("playlist");
// Toggle playlist button
controls_mc.playlist_mc.onRelease = function ()
if (thumbs_out == false)
thumbs_out = true;
title_out = true;
else if (thumbs_out == true)
thumbs_out = false;
title_out = false;
} // end if else
// Define hit area for playPause button
vid.onPress = controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("play")
playStatus = 0;
checkStatus();
else if (playStatus == 0)
controls_mc.playPause.gotoAndStop("pause");
playStatus = 1;
checkStatus();
// playPause button
controls_mc.playPause.onRollOver = function ()
if (playStatus == 1)
this.gotoAndStop("pauseOver");
else
this.gotoAndStop("playOver");
} // end else if
controls_mc.playPause.onRollOut = controls_mc.playPause.onReleaseOutside = function ()
if (playStatus == 1)
this.gotoAndStop("pause");
else
this.gotoAndStop("play");
} // end else if
// Toggle playPause button
controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
this.gotoAndStop("play");
playStatus = 0;
checkStatus();
else if (playStatus == 0)
this.gotoAndStop("pause");
playStatus = 1;
checkStatus();
controls_mc.skip_mc.onRollOver = function ()
this.gotoAndStop("skipOver");
controls_mc.skip_mc.onRollOut = controls_mc.skip_mc.onReleaseOutside = function ()
this.gotoAndStop("skip");
controls_mc.skip_mc.onRelease = function ()
_parent.nextVideo()
// Play Again button
mc_playAgain.onRollOver = function ()
this.gotoAndStop("playAgainOver");
mc_playAgain.onRollOut = mc_playAgain.onReleaseOutside = function ()
this.gotoAndStop("playAgain");
// Toggle Play Again button
mc_playAgain.onRelease = function ()
this._visible = false;
ns.pause();
playStatus = 1;
checkStatus();
// make the seek bar clickable
controls_mc.mc_progress.mc_buff.onPress = function()
xpos = controls_mc.mc_progress._xmouse;
percent = Math.round(xpos/controls_mc.mc_progress._width*100);
seekTime = percent/100*FLVduration;
seekTime = Math.round(seekTime*100)/100;
ns.seek(seekTime);
// Set volume level
var s:Sound = new Sound();
s.setVolume(_root.volume_value);
controls_mc.mc_soundLevel.mc_volume._xscale = _root.volume_value;
// Volume control
controls_mc.mc_soundLevel.onPress = function()
volumeTo = (this._xmouse / this._width)*100;
this.mc_volume._xscale = volumeTo;
s.setVolume(volumeTo);
// Volume
_parent.createEmptyMovieClip("vSound", _parent.getNextHighestDepth());
vSound.attachAudio(ns);
var so = new Sound(vSound);
so.setVolume(_root.volume_value);
// Mute button
controls_mc.mute_mc.onRollOver = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("onOver");
else
this.gotoAndStop("muteOver");
} // end else if
controls_mc.mute_mc.onRollOut = controls_mc.mute_mc.onReleaseOutside = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("on");
else
this.gotoAndStop("mute");
} // end else if
// Toggle mute button
controls_mc.mute_mc.onRelease = function ()
if (so.getVolume() >= 1)
controls_mc.mc_soundLevel.mc_volume._xscale = 0;
so.setVolume(0);
this.gotoAndStop("muteOver");
else
controls_mc.mc_soundLevel.mc_volume._xscale = 70;
so.setVolume(_root.volume_value);
this.gotoAndStop("onOver");
} // end else if
// Resize video proportionaly
function regularSize ()
videoObj._width = 600;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > 360)
videoObj._height = 360;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (600 - videoObj._width) / 2;
videoObj._y = (360 - videoObj._height) / 2;
function largeSize ()
videoObj._width = Stage.width;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > Stage.height)
videoObj._height = Stage.height;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (Stage.width - videoObj._width) / 2;
videoObj._y = (Stage.height - videoObj._height) / 2;
// Fullscreen button
controls_mc.fullscreen_mc.onRollOver = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("fullOver");
else
this.gotoAndStop("fullCloseOver");
} // end else if
controls_mc.fullscreen_mc.onRollOut = controls_mc.fullscreen_mc.onReleaseOutside = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("full");
else
this.gotoAndStop("fullClose");
} // end else if
// Toggle fullscreen button
controls_mc.fullscreen_mc.onRelease = function ()
if (Stage["displayState"] == "normal")
Stage["displayState"] = "fullscreen";
_parent.video_txt.theText._visible = false;
else
Stage["displayState"] = "normal";
_parent.video_txt.theText._visible = true;if you mean sound works well when the gallery is tested without being loaded into another swf but fails when loaded, change the highlighted line:
// Import filter classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
// Set flash variables
var xmlFileUrl:String = "playlist.xml";
var auto_play:String = "true";
// Set xml file URL
if (_root.xmlfile) {
xmlFileUrl = _root.xmlfile;
var V_SRC;
var thuArray:Array = new Array();
var currentVideo:Number = 0;
var totalItems;
var numOfItems:Number;
var itemDistance:Number = 120+5;
var itemHeight:Number = 80+2;
var Value:Number = 1;
var boundry:Number = 1;
var ratio:Number = 1;
var diff:Number = 1;
var collectionWidth:Number = 1;
var buffer:Number = 135*2;
this.createEmptyMovieClip("video_txt",this.getNextHighestDepth());
video_txt.createTextField("theText",video_txt.getNextHighestDepth(),0,0,584,36);
video_txt.theText.selectable = false;
video_txt.theText.autoSize = "left";
//The Format
myFormat = new TextFormat();
myFormat.font = _root.font_format;
myFormat.size = _root.font_size;
myFormat.color = _root.font_color;
myFormat.align = "center";
video_txt.theText.setNewTextFormat(myFormat);
// Create a new movieclip to load the thumbs
var thumbLoader:MovieClipLoader = new MovieClipLoader();
var thumbListener:Object = new Object();
thumbLoader.addListener(thumbListener);
thumbListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number)
new Tween(target_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
target_mc._parent.preloader_mc._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = xmlLoaded;
xml.load(xmlFileUrl);
// Load the xml file into the player
function xmlLoaded(b:Boolean) {
if (b) {
auto_play = this.firstChild.firstChild.attributes.auto_play;
scrollSpeed = parseInt(this.firstChild.firstChild.attributes.scrollSpeed);
totalItems = this.firstChild.firstChild.childNodes;
numOfItems = totalItems.length;
for (j=0; j<numOfItems; j++) {
var i = player_mc.main_mc.collection_mc.attachMovie("mc_Thumb", "thumb_"+j, j);
i._x = itemDistance*j;
thumbLoader.loadClip(totalItems[j].attributes.thumb,i.loader_mc);
i.id = j;
i.videoTitle = totalItems[j].attributes.title;
i.videoUrl = totalItems[j].attributes.src;
// Create an event for thumb rollover
i.onRollOver = iRoll;
i.onRollOut = i.onReleaseOutside=iOut;
i.onRelease = iRelease;
thuArray[j] = i;
// default first video
collectionWidth = player_mc.main_mc.collection_mc._width;
currentVideo = 0;
V_SRC = thuArray[0].videoUrl;
changeVideo();
//scope._alpha = 100;
new Tween(scope, "_alpha", Regular.easeOut, 0, 100, 0.5, true);
else
trace("Error! xml file not loaded");
// onRollOver Events
function iRoll() {
player_mc.mc_title.title_txt.htmlText = totalItems[this.id].attributes.title;
this.light_mc.play();
function iRelease() {
currentVideo = this.id;
changeVideo();
function changeVideo() {
V_SRC = thuArray[currentVideo].videoUrl;
player_mc.loadVideo();
currentThumb();
player_mc.mc_title.title_txt.htmlText = thuArray[currentVideo].videoTitle;
video_txt.theText.text = totalItems[currentVideo].attributes.title;
player_mc.so.getVolume();
player_mc.playStatus = 1;
player_mc.checkStatus();
function nextVideo() {
if (currentVideo<(numOfItems-1)) {
currentVideo++;
} else {
currentVideo = 0;
changeVideo();
function currentThumb() {
for (i=0; i<thuArray.length; i++) {
if (i == currentVideo) {
thuArray[i].enabled = true;
// Mouse movement on rollover
this.onMouseMove = function() {
collectionWidth = player_mc.main_mc.collection_mc._width;
boundry = player_mc.main_mc.area_mc._width;
if ((player_mc.main_mc._ymouse>0) && (player_mc.main_mc._ymouse<itemHeight)) {
if ((player_mc.main_mc._xmouse>0) && (player_mc.main_mc._xmouse<boundry)) {
ratio = player_mc.main_mc._xmouse/boundry;
diff = (collectionWidth-boundry)+buffer;
Value = Math.floor((-ratio)*diff)+(buffer/2);
updateAfterEvent();
this.onEnterFrame = function() {
// Define movement area and speed
if (player_mc.main_mc.collection_mc._width>player_mc.main_mc.area_mc._width) {
player_mc.main_mc.collection_mc._x = Math.round((player_mc.main_mc.collection_mc._x)+((Value-player_mc.main_mc.colle ction_mc._x)/scrollSpeed));
if (player_mc.main_mc.collection_mc._x>0) {
player_mc.main_mc.collection_mc._x = 0;
} else if (player_mc.main_mc.collection_mc._x<(player_mc.main_mc.area_mc._width-(player_m c.main_mc.collection_mc._width))) {
player_mc.main_mc.collection_mc._x = Math.round(player_mc.main_mc.area_mc._width-(player_mc.main_mc.collection_mc._w idth));
} else {
player_mc.main_mc.collection_mc._x = 0;
updateAfterEvent();
part two:
// Define flash variables
var video_url:String = "";
var tempx:Number = this._parent._x;
var tempy:Number = this._parent._y;
var timeCounter:Number = 0;
var timeInSeconds:Number = _root.time_counter;
// Object to listen to onStage Event
videoObj = vid.videoObj;
// Setting up the connection
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
// Buffer time
ns.setBufferTime (10);
videoObj.attachVideo (ns);
function loadVideo () {
video_url = _parent.V_SRC;
trace(video_url);
ns.play (video_url);
function checkStatus()
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("pause");
mc_playAgain._visible = false;
thumbs_out = false;
title_out = false;
else
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
} // end else if
if (so.getVolume() == 0)
controls_mc.mute_mc.gotoAndStop("mute");
else
controls_mc.mute_mc.gotoAndStop("on");
}; // End of the function
mc_playAgain._visible = false;
// Check Status of video
ns.onStatus = function (info)
if (info.code == "NetStream.Buffer.Empty")
mc_buffer._visible = true;
else if (info.code == "NetStream.Buffer.Full")
mc_buffer._visible = false;
else if (info.code == "NetStream.Play.Stop")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
else
trace;
} // end else if
mc_playAgain._visible = true;
mc_buffer._visible = false;
thumbs_out = true;
title_out = true;
checkStatus();
} // end else if
// Get info about video
ns.onMetaData = function(infoObject:Object)
FLVduration = infoObject["duration"];
relationshipW = infoObject.height / infoObject.width;
relationshipH = infoObject.width / infoObject.height;
if (Stage["displayState"] == "fullScreen")
largeSize ();
else
regularSize ();
if (_parent.auto_play == "false")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
mc_buffer._visible = false;
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
thumbs_out = true;
title_out = true;
_parent.auto_play = "true";
}// end else if
var videoInterval = setInterval(videoStatus, 100);
var amountLoaded;
var duration;
// videoStatus on load Event
function videoStatus()
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
controls_mc.mc_progress.mc_buff._width = amountLoaded * 250;
controls_mc.mc_progress.mc_played._x = ns.time / duration * 250;
controls_mc.mc_progress.mc_played._xscale = Math.round(ns.time*100/FLVduration);
}; // End of the function
function scrubIt()
ns.seek(Math.floor(controls_mc.mc_progress.mc_played._x / 250 * duration));
}; // End of the function
// video time
var time_interval:Number = setInterval(checkTime, 500, ns);
function checkTime(ns:NetStream) {
//current time
var ns_seconds:Number = ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
sec = seconds;
min = minutes;
if (sec<10) {
sec = "0"+sec;
if (min<10) {
min = "0"+min;
controls_mc.time_txt.time_1.text = min+":"+sec;
//total time
var minutes2:Number = Math.floor(FLVduration/60);
var seconds2 = Math.floor(FLVduration%60);
sec2 = seconds2;
min2 = minutes2;
if (sec2<10) {
sec2 = "0"+sec2;
if (min2<10) {
min2 = "0"+min2;
controls_mc.time_txt.time_2.text = min2+":"+sec2;
if (controls_mc.time_txt.time_2.text == "NaN:NaN") {
controls_mc.time_txt.time_2.text = "00:00";
setStage ();
// Object to listen onStage Event
var stageL:Object = new Object ();
// function respnsible for content alignment
function setStage ()
if (Stage["displayState"] == "fullScreen") {
tempx = this._parent._x;
tempy = this._parent._y;
this._parent._x = 0;
this._parent._y = 0;
vidBg_mc._x = 0;
vidBg_mc._y = 0;
mc_title._x = 0;
mc_title._y = -30;
slide_me._x = 0;
slide_me._y = 0;
vidBg_mc._width = Stage.width;
vidBg_mc._height = Stage.height;
mc_title._width = Stage.width;
mc_title._height = Stage.height / 20;
slide_me._width = Stage.width;
slide_me._height = Stage.height / 20;
vid._x = vid._y = 0;
largeSize ();
controls_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));
controls_mc._y = Math.round (Stage.height - 36);
mc_playAgain._x = Math.round ((Stage.width / 2) - (mc_playAgain._width / 2));
mc_playAgain._y = Math.round (Stage.height - 572);
thumbs_mc._x = Math.round ((Stage.width / 2) - (thumbs_mc._width / 2));
thumbs_mc._y = Math.round (Stage.height - 115);
main_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));;
hide_mc.onEnterFrame = function () {
timeCounter = timeCounter + 1;
if (timeCounter >= timeInSeconds * 30) {
timeCounter = 0;
controls_mc._alpha = 0;
this.onMouseMove = function () {
timeCounter = 0;
controls_mc._alpha = 100;
else
delete hide_mc.onEnterFrame;
delete this.onMouseMove;
controls_mc._alpha = 100;
this._parent._x = tempx;
this._parent._y = tempy;
vidBg_mc._width = 600;
vidBg_mc._height = 360;
mc_title._width = 600;
mc_title._height = 30;
slide_me._width = 600;
slide_me._height = 30;
vidBg_mc._x = vid._x = 0;
vidBg_mc._y = vid._y = 35;
mc_title._x = vid._x = 0;
mc_title._y = vid._x = -30;
slide_me._x = vid._x = 0;
slide_me._y = vid._y = 35;
regularSize ();
controls_mc._x = 0;
controls_mc._y = 395;
mc_playAgain._x = 243;
mc_playAgain._y = 158;
thumbs_mc._x = 0;
thumbs_mc._y = 316;
main_mc._x = 0;
main_mc._y = 406;
mc_buffer._x = Math.round (vidBg_mc._x + (vidBg_mc._width / 2));
mc_buffer._y = Math.round (vidBg_mc._y + (vidBg_mc._height / 2));
// to apply when stage (browser window) is resized or modified
stageL.onResize = function () {
setStage ();
// attaching object to the stage
Stage.addListener (stageL);
MovieClip.prototype.slide = function(yPos) {
this._y -= (this._y-yPos)/5;
// tilte actions
mc_title.onEnterFrame = function()
if (Stage["displayState"] == "normal" && title_out == false)
this.slide(5);
else if (Stage["displayState"] == "normal" && title_out == true)
this.slide(35);
if (Stage["displayState"] == "fullScreen" && title_out == false)
this._y -= (this._y+106)/5;
else if (Stage["displayState"] == "fullScreen" && title_out == true)
this.slide(0);
// thumbs actions
main_mc.onEnterFrame = function()
if (Stage["displayState"] == "normal" && thumbs_out == false)
this.slide(406);
else if (Stage["displayState"] == "normal" && thumbs_out == true)
this.slide(299);
if (Stage["displayState"] == "fullScreen" && thumbs_out == false)
this._y = Math.round (Stage.height - 0);
else if (Stage["displayState"] == "fullScreen" && thumbs_out == true)
this._y = Math.round (Stage.height - 133);
// Playlist button
controls_mc.playlist_mc.onRollOver = function ()
this.gotoAndStop("playlistOver");
controls_mc.playlist_mc.onRollOut = controls_mc.playlist_mc.onReleaseOutside = function ()
this.gotoAndStop("playlist");
// Toggle playlist button
controls_mc.playlist_mc.onRelease = function ()
if (thumbs_out == false)
thumbs_out = true;
title_out = true;
else if (thumbs_out == true)
thumbs_out = false;
title_out = false;
} // end if else
// Define hit area for playPause button
vid.onPress = controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("play")
playStatus = 0;
checkStatus();
else if (playStatus == 0)
controls_mc.playPause.gotoAndStop("pause");
playStatus = 1;
checkStatus();
// playPause button
controls_mc.playPause.onRollOver = function ()
if (playStatus == 1)
this.gotoAndStop("pauseOver");
else
this.gotoAndStop("playOver");
} // end else if
controls_mc.playPause.onRollOut = controls_mc.playPause.onReleaseOutside = function ()
if (playStatus == 1)
this.gotoAndStop("pause");
else
this.gotoAndStop("play");
} // end else if
// Toggle playPause button
controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
this.gotoAndStop("play");
playStatus = 0;
checkStatus();
else if (playStatus == 0)
this.gotoAndStop("pause");
playStatus = 1;
checkStatus();
controls_mc.skip_mc.onRollOver = function ()
this.gotoAndStop("skipOver");
controls_mc.skip_mc.onRollOut = controls_mc.skip_mc.onReleaseOutside = function ()
this.gotoAndStop("skip");
controls_mc.skip_mc.onRelease = function ()
_parent.nextVideo()
// Play Again button
mc_playAgain.onRollOver = function ()
this.gotoAndStop("playAgainOver");
mc_playAgain.onRollOut = mc_playAgain.onReleaseOutside = function ()
this.gotoAndStop("playAgain");
// Toggle Play Again button
mc_playAgain.onRelease = function ()
this._visible = false;
ns.pause();
playStatus = 1;
checkStatus();
// make the seek bar clickable
controls_mc.mc_progress.mc_buff.onPress = function()
xpos = controls_mc.mc_progress._xmouse;
percent = Math.round(xpos/controls_mc.mc_progress._width*100);
seekTime = percent/100*FLVduration;
seekTime = Math.round(seekTime*100)/100;
ns.seek(seekTime);
// Set volume level
var s:Sound = new Sound(this);
s.setVolume(_root.volume_value);
controls_mc.mc_soundLevel.mc_volume._xscale = _root.volume_value;
// Volume control
controls_mc.mc_soundLevel.onPress = function()
volumeTo = (this._xmouse / this._width)*100;
this.mc_volume._xscale = volumeTo;
s.setVolume(volumeTo);
// Volume
_parent.createEmptyMovieClip("vSound", _parent.getNextHighestDepth());
vSound.attachAudio(ns);
var so = new Sound(vSound);
so.setVolume(_root.volume_value);
// Mute button
controls_mc.mute_mc.onRollOver = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("onOver");
else
this.gotoAndStop("muteOver");
} // end else if
controls_mc.mute_mc.onRollOut = controls_mc.mute_mc.onReleaseOutside = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("on");
else
this.gotoAndStop("mute");
} // end else if
// Toggle mute button
controls_mc.mute_mc.onRelease = function ()
if (so.getVolume() >= 1)
controls_mc.mc_soundLevel.mc_volume._xscale = 0;
so.setVolume(0);
this.gotoAndStop("muteOver");
else
controls_mc.mc_soundLevel.mc_volume._xscale = 70;
so.setVolume(_root.volume_value);
this.gotoAndStop("onOver");
} // end else if
// Resize video proportionaly
function regularSize ()
videoObj._width = 600;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > 360)
videoObj._height = 360;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (600 - videoObj._width) / 2;
videoObj._y = (360 - videoObj._height) / 2;
function largeSize ()
videoObj._width = Stage.width;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > Stage.height)
videoObj._height = Stage.height;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (Stage.width - videoObj._width) / 2;
videoObj._y = (Stage.height - videoObj._height) / 2;
// Fullscreen button
controls_mc.fullscreen_mc.onRollOver = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("fullOver");
else
this.gotoAndStop("fullCloseOver");
} // end else if
controls_mc.fullscreen_mc.onRollOut = controls_mc.fullscreen_mc.onReleaseOutside = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("full");
else
this.gotoAndStop("fullClose");
} // end else if
// Toggle fullscreen button
controls_mc.fullscreen_mc.onRelease = function ()
if (Stage["displayState"] == "normal")
Stage["displayState"] = "fullscreen";
_parent.video_txt.theText._visible = false;
else
Stage["displayState"] = "normal";
_parent.video_txt.theText._visible = true; -
Need help with XML response to refresh document with context and prompts
I've been working with the Restful api for a few weeks now and have been able to figure out most of what I need to automate testing of our reports. However, one task that I have not been able to figure out is how to refresh a document that contains both a context and two prompts for dates.
Here is what I have tried, and what the API responds with.
1) I queried the API for this document's parameters using the following call after logging in -
headers = {:accept=>'application/xml', :content_type=>'application/xml', :x_sap_logontoken=>@token}
url = "http://our.url.net:6405/biprws/raylight/v1/documents/12345/parameters"
RestClient.get(url, headers)
The response from the API is:
<parameters>
<parameter dpId="DP0" type="context" optional="false">
<id>0</id>
<technicalName>cQuery 1</technicalName>
<name>Select a context</name>
<answer type="Text" constrained="true">
<info cardinality="Single">
<lov partial="false">
<values>
<value id="CTX_1">LOAN</value>
<value id="CTX_9">LOAN_APPLICATION</value>
</values>
</lov>
<values>
<value id="CTX_1">LOAN</value>
<value id="CTX_9">LOAN_APPLICATION</value>
</values>
<previous>
<value id="CTX_9">LOAN_APPLICATION</value>
</previous>
</info>
<values>
<value id="CTX_9">LOAN_APPLICATION</value>
</values>
</answer>
</parameter>
</parameters>
2) This tells me I need to supply a context, so I then replace my RestClient.get call with a RestClient.put call with the following payload:
<parameters>
<parameter>
<id>0</id>
<answer>
<values>
<value id=\"CTX_9\"/>
</values>
</answer>
</parameter>
</parameters>
3) This satisfies the context portion of the refresh. The API replies with the following response, telling me I need to answer two prompts -
<parameters>
<parameter dpId=\"DP0\" type=\"prompt\" optional=\"false\">
<id>1</id>
<technicalName>psEnter value(s) for Start Date of Application Received Date</technicalName>
<name>Enter value(s) for Start Date of Application Received Date</name>
<answer type=\"DateTime\" constrained=\"false\">\
<info cardinality=\"Single\"/>
</answer>
</parameter>
<parameter dpId=\"DP0\" type=\"prompt\" optional=\"false\">
<id>2</id>
<technicalName>psEnter value for End Date of Application Received Date</technicalName>
<name>Enter value for End Date of Application Received Date</name>\
<answer type=\"DateTime\" constrained=\"false\">
<info cardinality=\"Single\"/>
</answer>
</parameter>
</parameters>
4) Here is where I am having problems. I have tried all kinds of permutations of the below payload/response body. All I ever get from the API is a 400 - BadResponse error.
<parameters>
<parameter>
<id>0</id>
<answer>
<values>
<value id=\"CTX_9\"/>
</values>
</answer>
</parameter>
</parameters>
<parameters>
<parameter type=\"prompt\">
<id > 1 </ id>
<answer type=\"DateTime\">
<values>
<value>2012-06-11T09:50:54.000-04:00</value>
</values>
</answer>
</parameter>
<parameter type=\"prompt\">
<id > 2 </ id>
<answer type=\"DateTime\">
<values>
<value>2014-07-11T09:50:54.967-04:00</value>
</values>
</answer>
</parameter>
</parameters>
I am not very good with XML and the terminology around it, and I haven't received much training around using the Restful API other than the SDK documentation. I have a feeling there is something very basic that Im missing here. What is the correct XML needed in the response body to properly refresh the document?If you are more confortable with JSON, Raylight supports it as well.
Best regards,
Anthony -
I need help with XML coding. Please reply
I recently created a podcast. I submitted it to iTunes. All was successful but the download speed was Horrible. I had about 10 people test it -- after that the ISP I use shifted my Domain to a Streaming Server. The Tech then changed the specs to my iTunes <guid>. I updated the info on iTunes, but since then no one has been able to download it from iTunes. The RSS feed on the page ( website) works, but if I type it in to an RSS feed, I am even having problems getting it to recognize it.
I feel the main problem is that the shifting of servers and changing the <guid> caused a major problem. Since my ISP and Tech rep is mainly Windows oriented, his expertise with Apple is very little. ( As is mine ).
I will insert a snippet of the code and ask for Help... I really need to fix this, because I have secured another Domain, and wish to create a new podcast.
(BTW if any one listens to any of them, I now have a mixing board and Mic.. so I am trying to better it.)
Website: www.riverratdoc.com
snippet of XML code
<enclosure url="http://stream.riverratdoc.com/RiverratDoc/episode1a.mp3" length="9551933" type="audio/mpeg" />
<guid isPermaLink="false">09072010EPS01</guid><!-- just make unique per episode -->
<pubDate>Fri, 9 Jul 2010 12:40:01 GMT</pubDate>
Thank you in advance
River Rat DocThe problem doesn't lie with your feed, although it does contain an error - you have given a non-existent sub-category. You need to stick to the categories and sub-categories listed here:
http://www.apple.com/itunes/podcasts/specs.html#categories
Subscribing to your feed from the iTunes Store page work as such, but the episodes throw up an error message. The problem lies with your episode media files: you are trying to stream them. Pasting the URL into a browser produces a download (where it should play the file) of a small file which does not play and in fact is a text file containing (in the case of ep.2) this:
[Reference]
Ref1=http://stream.riverratdoc.com/RiverratDoc/episode2.mp3?MSWMExt=.asf
Ref2=http://70.33.177.247:80/RiverratDoc/episode2.mp3?MSWMExt=.asf
You must provide a direct link to the actual mp3 file. Streaming won't work. The test is that if you paste the URL of the media file (as given in the feed) into the address bar of a browser it should play the file. -
I have a very large unstructured document that I need to convert to XML. This document once had a structure applied to it but somehow this structure was deleted (not by me). Since the structure was deleted, a fair amount of content has been added to the file.
Ive been reading through PDF help files and trying to figure out how to solve this problem. I am very new to this so any help or input would really be great.
So far thoughts on converting to XML are:
1) Get structure back working in the original file. I do not know if there is a way to transfer the structure Pre-Loss to the new file. I have created a conversion table already that I can use. I have ran the CT and created what seems to be a structured document, but I think I may be missing further steps.
2) Export the element definitions to an EDD
3) Convert the EDD to a DTD
4) Create a template file (not sure how to do this?)
Finally export to XML. Before I start on this some feedback would be very welcomed. Sorry I am very inexperienced with all of this.Hello Frank,
with the conversion there is a problem concering the graphics/ xrefs.
after you have created the conversion table and structured your document you now can
save the document as xml file.
In the output you then will still have all graphics that are in the document, but the xrefs are missing.
convert the document via StructureTools > Utilities > Convert Documents to Structured Format.
In the output you then will have all the xrefs, but the graphics are missing.
However, it's possible that I'm not up-to-date her as I haven't tried this since quite some time now.
Point 2 and 3 from your list:
Normally it's the other way around: You have a DTD and import that as a new EDD file in FrameMaker.
Also I don't think that there really is a possiblity to export any element definitions from FrameMaker. But I'm happy, if you are able to disabuse me here.
Template file:
Any FM file. It just contains the page layout and the character formats etc.
What you need to do is to add a Structured Application containing all the information on where to find the Template, EDD, DTD and also the read and write rules.
With FrameMaker there are several Structured Applications delivered, e.g. DITA.
If you do not have enough experience to create a new structured application without any model, it's best to copy and modify one of these.
Regards,
Anna -
Hello experts,
I have to validate a xml against schema.I have used some java code & xerces jar ro solve this problem.It's working fine.But it's showing only first error & it's coming out.I want to list all the errors.Please help me by guiding how to achieve it.Right now the code I am using is easy enough , I just need to provide the schema file & xml file.But if I have to find out all the errors , do I need to parse it line by line?Please help.Thanx tonn in advance.Ya . this is possible if you have heard about XSLT transformation .
File xmlFile = new File("XmlFileToTransform");
File xsltFile = new File("U R SCHEMA");
XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setEntityResolver(new NullResolver());
FileOutputStream fos = new FileOutputStream(out);
Writer out = new BufferedWriter(new OutputStreamWriter(fos,
"UTF8"));
SAXSource xmlSource = new SAXSource(reader, new InputSource(
xmlFile.toURI().getRawPath()));
Source xsltSource = new StreamSource(xsltFile);
Result result = new StreamResult(out);
// create an instance of TransformerFactory
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);
trans.transform(xmlSource, result); // this will transform xml according to u r xslt file
out.close();see if this is helpful for u ! -
I'm trying to load in XML text. I'm looking for an efficient
method of doing so.
Ideally, I'd like the text to fade in and out with the image.
Maybe adding a subtle animation/movement to the text box would be
nice. Perhaps a MC that plays intervals of movement with a dynamic
text box... i just don't know how to do it.
Sample files
CLICK HERE
845kbstart simple and build. check the xml class so you can see
how to create a simple xml file, load it and parse its contents.
then progress step-wise towards your project. -
Need help with XML Compatibility between CS3 and CS4
I'm not a Dreamweaver guru but I am hoping someone will recognize my issue and be able to provide meaningful feedback.
Background:
A developer buddy and I are working together to create a new home page for an online retailer that utilizes flash banners. We're using XML to update the content of the banners. My buddy is creating the XML file and sending it to me to populate with content (i.e. descriptions, images, image paths, etc.). He is creating the XML file in CS3 and I am editing in CS4. Here's the issue: Whenever he uploads the populated XML file to the server the banners are displayed correctly. If I take the same file and upload it without editing, it works great. However, if I open the file, edit and resave before uploading to the web server, the the banners all have extra spaces between each line of content - almost as if it were double spaced. If you look at the code, the code looks fine. In fact, the code looks exactly like it did when my buddy sent the file to me. I believe we have isolated the problem to something weird with my installation of DW. I have downloaded and installed any and all updates. Oh yeah he's using a MAC version and I am using the PC version of DW.
Has anyone seen anything like this before???
Help...Thank you for your response.
The code is listed below and to tell you the truth the following code is both good and bad. As I mentioned before, if my buddy sends me this xml file and I upload it to the server, it works fine. If I open the file and immediately save it without making any changes then upload it, I experience the previously described promblem. It's very strange. The code in both files is identical.
To get a clearer picture of what I am describing, go to http://www.everythingministry.com/beta3.htm. The book descriptions appear correctly under the "New and Recommended" tab. However, whenever I edit any one of the six xml files that control the content for each of these tabs it ends up looking like what you currently see under the "New Music" tab. I have actually tried to update from 2 different machines running DW CS4.
Below are the xml files for the two tabs I referenced in the paragraph above:
ts_new.xml
<items>
<config
Milliseconds="5000"
Distance="3"
BorderColor="0xffffff"
TargetLink="_top"
TextYPosition="200"
MaxDisplayContent="6"
ContentWidth="148"
ContentHeight="300"
TransitionSpeed="0.8"
TransitionType="0"
ShowMouseOver="0"
ShowBorder="1"
ShowGlass="1"
/>
<content>
<image>images/crazylove.jpg</image>
<description><![CDATA[Crazy Love
by Chan Francis
Price: $11.99
You Save: 20 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/crazylove.aspx</link>
</content>
<content>
<image>images/underthesheets.jpg</image>
<description><![CDATA[Under the Sheets
by Dr. Kevin Leman
Price: $9.99
You Save: 29 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/underthesheetsthesecretstohotsexinyourmarriage.aspx</link>
</content>
<content>
<image>images/outliveyourlife.jpg</image>
<description><![CDATA[Outlive Your Life
by Max Lucado
Price: $19.99
You Save: 20 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/outliveyourlifebymaxlucadohardcover.aspx</link>
</content>
<content>
<image>images/lovedare.jpg</image>
<description><![CDATA[Love Dare Day By Day
Wedding Edition
Price: $16.79
You Save: 27 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/lovedaredaybyday-weddingedition.aspx</link>
</content>
<content>
<image>images/lifeinterrupted.jpg</image>
<description><![CDATA[Life Interrupted
by Priscilla Shirer
Price: $11.99
You Save: 20 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/lifeinterruptednavigatingtheunexpected.aspx</link>
</content>
<content>
<image>images/faithfulfasting.jpg</image>
<description><![CDATA[Faithful Fasting
by Errica L. Williams
Price: $8.79
You Save: 20 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/faithfulfasting.aspx</link>
</content>
<content>
<image>images/whencouples.jpg</image>
<description><![CDATA[When Couples Walk Together
Price: $9.59
You Save: 20 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/whencoupleswalktogetherjan2011-paperback.aspx</link>
</content>
</items>
ts_music.xml
<items>
<config
Milliseconds="5000"
Distance="3"
BorderColor="0xffffff"
TargetLink="_top"
TextYPosition="200"
MaxDisplayContent="6"
ContentWidth="148"
ContentHeight="300"
TransitionSpeed="0.8"
TransitionType="0"
ShowMouseOver="0"
ShowBorder="1"
ShowGlass="1"
/>
<content>
<image>images/untilthewholeworldhearscd.jpg</image>
<description><![CDATA[Until the Whole
World Hears
Price: $12.76
You Save: 20 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/untilthewholeworldhearscd.aspx</link>
</content>
<content>
<image>images/move.jpg</image>
<description><![CDATA[Move
by Thirda Day
Price: $11.19
You Save: 20 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/move.aspx</link>
</content>
<content>
<image>images/andifourgodisforus.jpg</image>
<description><![CDATA[And If Our God
Is For Us
Price: $11.19
You Save: 20 %
<img src="images/addtocart.jpg" width="146" height="17">]]></description>
<link>http://www.everythingministry.com/andifourgodisforuscd.aspx</link>
</content>
</items> -
HI All,
i have sap internal table with this value and i want to mapp it to xml file like below,
Name value
User 1234
DueDate yyyyy
<User>1234</User>
<DueDate>yyyyy</DueDate>
the problem is when i use call transformation i get in the table
<name>1234</name>
<value>yyyyy</value>
how can i get the mapp that i need ?
Regards
JOy
Edited by: Joy Stpr on Aug 10, 2009 2:56 PM
Edited by: Joy Stpr on Aug 10, 2009 3:47 PMCheck this
Program Code
report zars
no standard page heading line-size 255.
data: xml_out type string .
data: begin of ty_data,
name type string,
value type string,
end of ty_data.
types: begin of ty_user,
user type sy-uname,
duedate type sy-datum,
end of ty_user.
data: itab type standard table of ty_user,
la_tab like line of itab,
xmlstr type xstring.
la_tab-user = 'TEST1'.
la_tab-duedate = '200908101'.
append la_tab to itab.
clear la_tab.
la_tab-user = 'TEST2'.
la_tab-duedate = '200909101'.
append la_tab to itab.
clear la_tab.
data : itab1 type swbhtmltable.
data: it_data like table of ty_data,
wa_data like line of it_data.
data result type string.
call transformation zaRs
source table = itab
result xml xml_out.
call function 'SWA_STRING_TO_TABLE'
exporting
character_string = xml_out
importing
character_table = itab1.
call function 'GUI_DOWNLOAD'
exporting
filetype = 'BIN'
filename = 'c:xx.xml'
tables
data_tab = itab1.
XLST Program
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="table"></tt:root>
<tt:template>
<table>
<tt:loop ref=".table">
<item>
<USER>
<tt:value ref="USER"></tt:value>
</USER>
</item>
<item>
<DUEDATE>
<tt:value ref="DUEDATE"></tt:value>
</DUEDATE>
</item>
</tt:loop>
</table>
</tt:template>
</tt:transform>
Result XML File
<?xml version="1.0" encoding="iso-8859-1" ?>
- <table>
- <item>
<USER>TEST1</USER>
</item>
- <item>
<DUEDATE>2009-08-10</DUEDATE>
</item>
- <item>
<USER>TEST2</USER>
</item>
- <item>
<DUEDATE>2009-09-10</DUEDATE>
</item>
</table>
a®
Maybe you are looking for
-
ASA 5505 Site to Site and Web VPN
Hello all, I need to add a site to site tunnel from a an ASA 5505 (ver 8.05) to a Sonic wall appliance. The problem is, the ASA already has remote access VPN and anyconnect VPN configured. I'm not sure if its possible to add another secured tunnel to
-
I downloaded the latest version of flash player, not working?
I just got my computer back from being fixed and I'm redownloading everything I need. I have a Mac OS X Version 10.7.5 and i downloaded the latest version of flash player for it. It appears to be installed because there's a window opens up saying "Th
-
I needed dual band and more bandwidth so I upgraded the wireless card from the Ralink RT5390R that comes installed with the machine to the Intel Centrino Advanced-N 6235. I contacted HP support and was given the part number (670292-001) and it was in
-
BusinessObjects Enterprise 功能请教?
hi, 刚接触BO Enterprise,请教一下如果我用WebI或者InfoView出一张报表,想在报表上加个备注功能.就是如果用户查了报表a, 然后有个地方可以像Outlook里的notes一样记录点东西,等他下次再打开这个报表的时候还能看到自己的Notes. 刚接触,实在没方向,这算不算报表开发了?BOE提供的JAVA SDK是派这种用的马? 谢谢了.
-
Help me merge my MSA with Skype account. Not as si...
I need to merge my MSA with my new Skype account. I cannot unlink it from my old account because it tells me to contact customer support. My old account has no sype name, it's just my MSA to log in. All I want to do is have my MSA on my NEW skype acc