Help with XML gallery
I have created a picture gallery which is controlled by
thumbnails. Now I wanted to add a function to open the picture
showing, in seperate window, when it is clicked on. But I can't
figure this xml out, someone please help me.
*BUMP* Anyone!?
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 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; -
Help with Photo Gallery using XML file
I am creating a photo gallery using Spry. I used the Photo Gallery Demo (Photo Gallery Version 2) on the labs.adobe.com website. I was successful in creating my site, and having the layout I want. However I would like to display a caption with each photo that is in the large view.
As this example uses XML, I updated my file to look like this:
<photos id="images">
           <photo path="aff2010_01.jpg" width="263" height="350" thumbpath="aff2010_01.jpg" thumbwidth="56"
              thumbheight="75" pcaption="CaptionHere01"></photo>
           <photo path="aff2010_02.jpg" width="350" height="263" thumbpath="aff2010_02.jpg" thumbwidth="75"
              thumbheight="56" pcaption="CaptionHere02"></photo>
           <photo path="aff2010_03.jpg" width="350" height="263" thumbpath="aff2010_03.jpg" thumbwidth="75"
              thumbheight="56" pcaption="CaptionHere03"></photo>
</photos>
The images when read into the main file (index.asp) show the images in the thumbnail area and display the correct image in the picture pain. Since I added the pcaption field to the XML file, how do I get it to display? The code in my index.html file looks like this:rest of the code here:
      <div id="previews">
         <div id="controls">
            <ul id="transport">
               <li><a href="#" class="previousBtn" title="Previous">Previous</a></li>
               <li><a href="#" class="playBtn" title="Play/Pause" id="playLabel"><span class="playLabel">Play</span><span class="pauseLabel">Pause</span></a></li>
               <li><a href="#" class="nextBtn" title="Next">Next</a></li>
            </ul>
         </div>
         <div id="thumbnails" spry:region="dsPhotos" class="SpryHiddenRegion">
            <div class="thumbnail" spry:repeat="dsPhotos"><a href="{path}"><img alt="" src="{thumbpath}"/></a><br /></div>
            <p class="ClearAll"></p>
         </div>
      </div>
      <div id="picture">
         <div id="mainImageOutline"><img id="mainImage" alt="main image" src=""/><br /> Caption: {pcaption}</div>
      </div>
      <p class="clear"></p>
   </div>
Any help with getting the caption to display would be greatly appreciated. The Caption {pcaption} does not work, -
Urgent Help with Image Gallery
Hi,
I really need help with an image gallery i have created. Cannot think of a resolution
So....I have a dynamic image gallery that pulls the pics into a movie clip and adds them to the container (slider)
The issue i am having is that when i click on this i am essentially clicking on all the items collectively and i would like to be able to click on each image seperately...
Please see code below
var xml:XML;
var images:Array = new Array();
var totalImages:Number;
var nbDisplayed:Number = 1;
var imagesLoaded:int = 0;
var slideTo:Number = 0;
var imageWidth = 150;
var titles:Array = new Array();
var container_mc:MovieClip = new MovieClip();
slider_mc.addChild(container_mc);
container_mc.mask = slider_mc.mask_mc;
function loadXML(file:String):void{
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest(file));
xmlLoader.addEventListener(Event.COMPLETE, parseXML);
function parseXML(e:Event):void{
xml = new XML(e.target.data);
totalImages = xml.children().length();
loadImages();
function loadImages():void{
for(var i:int = 0; i<totalImages; i++){
 var loader:Loader = new Loader();
 loader.load(new URLRequest("images/"+String(xml.children()[i].@brand)));
 images.push(loader);
//Â Â Â Â Â loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgress);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
function onComplete(e:Event):void{
imagesLoaded++;
if(imagesLoaded == totalImages){
 createImages();
function createImages():void{
for(var i:int = 0; i < images.length; i++){
 var bm:Bitmap = new Bitmap();
 bm = Bitmap(images[i].content);
 bm.smoothing = true;
 bm.x = i*170;
 container_mc.addChild(bm);
     var caption:textfile=new textfile();
     caption.x=i*170; // fix text positions (x,y) here
  caption.y=96;
     caption.tf.text=(xml.children()[i].@brandname)  Â
     container_mc.addChild(caption);yes, sorry i do wish to click on individual images but dont know how to code that
as i mentioned i have 6 images that load into an array and then into a container and i think that maybe the problem is that i have the listener on the container so when i click on any image it gives the same results.
what i would like is have code thats says
if i click on image 1 then do this
if i click on image 2 then do something different
etc
hope that makes sense
thanks for you help! -
Help with xml and getNextHighestDepth
I have a thumbnail gallery that is called in with xml- On
stage is a movieClip that covers the entire thumbnail area with the
alpha set to 0. what I'm trying to do is onRelease- have that mc
brought to the front and it's alpha state tween to 100- i've not
much experience using 'getNextHighestDepth' so I'm assuming
something is wrong here... if anyone can help I'd really appreciate
it!
Thanks!i think you want something along the lines of :
stageFade_mc.swapDepths(theMovieOnTopAtTheMoment);
Note that only dynamically created movies have depths. So if
either of the movieclips in question are just sitting in your
timeline you cant swap their depths.
In that case you either need to duplicateMovieClip() or just
set things _visible property where apropriate.
good luck
jon -
Help with XML, display data on swipe/click
Hello.
I am trying to create a moibile app that displays XML data. It's basically a phone book. I want the data to change when swiped. I can get the data in just fine. I can get it to display fine. I am not seeing the correct image first, however. I think it's a problem with my imagenum variable.
Then, I want to change what is displayed when the user clicks/swipes on the screen. How do I do that?
stop();
var nameArray:Array = new Array();
var countryArray:Array = new Array();
var portraitArray:Array = new Array();
var flagArray:Array = new Array();
var jobtitleArray:Array = new Array();
var imageNum:Number=0;
var totalImages:Number;
//Load XML
var XMLURLLoader:URLLoader = new URLLoader();
XMLURLLoader.load(new URLRequest("recbook.xml"));
XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(event:Event):void {
var theXMLData:XML = new XML(XMLURLLoader.data);
totalImages=theXMLData.name.length();
for (var i:Number =0; i < totalImages; i++){
//push xml data into the arrays
nameArray.push(theXMLData.name[i]);
countryArray.push(theXMLData.country[i]);
portraitArray.push(theXMLData.portrait[i]);
flagArray.push(theXMLData.flag[i]);
jobtitleArray.push(theXMLData.jobtitle[i]);
//data is processed
loadData();
function loadData():void {
var thisPortrait:String = portraitArray[imageNum];
var thisCountry:String = countryArray[imageNum];
var thisName:String = nameArray[imageNum];
var thisJobtitle:String = jobtitleArray[imageNum];
var thisFlag:String = flagArray[imageNum];
var dataLoader:Loader = new Loader();
dataLoader.load(new URLRequest(portraitArray[imageNum]));
dataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataLoaded);
function dataLoaded(event:Event):void {
//I want to start with image 0 (img1.jpg) and cycle through with a mouse click (finger swipe on iOS)
stage.addEventListener(MouseEvent.CLICK, loadMainImage1);
function loadMainImage1(event:MouseEvent):void {
portraitUILoader.source=thisPortrait;
flagUILoader.source=thisFlag;
selectedName.text=thisName;
selectedCountry.text=thisCountry;
selectedJobtitle.text=thisJobtitle;
//add to imageNum (1);
imageNum++;
if (imageNum < totalImages) {//stopping at img2
trace("imageNum " + imageNum);
trace("image name (thisPortrait) " + thisPortrait);//losing image 4 somewhere
loadData();
trace("Total Images " + totalImages);
//click to move past the home screenI'd like to ditch this. don't know how.
homeScreen_mc.addEventListener(MouseEvent.CLICK, goNext);
function goNext(event:MouseEvent):void
nextFrame();
*/here's the output:
imageNum 1
image name (thisPortrait) images/img1.jpg
imageNum 2
image name (thisPortrait) images/img2.jpg
imageNum 3
image name (thisPortrait) images/img3.jpg
Total Images 4
Total Images 4
Total Images 4
Total Images 4
It starts the display on image 1 (the second in the series img2.jpg)*/Thank you.
That helped. I get the correct images in the output, but not in the display. I also get the following error. Any chance you could help with that?
new output after moving the increment:
imageNum 0
image name (thisPortrait) images/img1.jpg
imageNum 1
image name (thisPortrait) images/img2.jpg
imageNum 2
image name (thisPortrait) images/img3.jpg
imageNum 3
image name (thisPortrait) images/img4.jpg
TypeError: Error #2007: Parameter url must be non-null.
at flash.display::Loader/_load()
at flash.display::Loader/load()
at iOS_fla::MainTimeline/loadData()
at iOS_fla::MainTimeline/loadData()
at iOS_fla::MainTimeline/loadData()
at iOS_fla::MainTimeline/loadData()
at iOS_fla::MainTimeline/loadData()
at iOS_fla::MainTimeline/processXML()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete() -
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> -
I found this cool photo gallery tutorial
http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm
but I'm having problem to put it together onto my flash web. I wold
like to make portfolio and I want to have several categories. Each
category will have its own photo gallery with animated buttons
loading in each gallery separately onto same area. something
similar to this
http://www.flashmint.com/show-template-1920.html
but where its loading text onto animated banners I want to load my
photo gallery. Any ideas how to put it together? I'm beginner with
action script . I use flash 8 proffesionalrest of the code here:
      <div id="previews">
         <div id="controls">
            <ul id="transport">
               <li><a href="#" class="previousBtn" title="Previous">Previous</a></li>
               <li><a href="#" class="playBtn" title="Play/Pause" id="playLabel"><span class="playLabel">Play</span><span class="pauseLabel">Pause</span></a></li>
               <li><a href="#" class="nextBtn" title="Next">Next</a></li>
            </ul>
         </div>
         <div id="thumbnails" spry:region="dsPhotos" class="SpryHiddenRegion">
            <div class="thumbnail" spry:repeat="dsPhotos"><a href="{path}"><img alt="" src="{thumbpath}"/></a><br /></div>
            <p class="ClearAll"></p>
         </div>
      </div>
      <div id="picture">
         <div id="mainImageOutline"><img id="mainImage" alt="main image" src=""/><br /> Caption: {pcaption}</div>
      </div>
      <p class="clear"></p>
   </div>
Any help with getting the caption to display would be greatly appreciated. The Caption {pcaption} does not work, -
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 -
Hello everybody. I decided to start working with XML since it allows me to load assets externally and edit my applications later very easily without having to edit the fla file itself. So today I watched and read a few tutorials and now I'm trying to build an Event Scroll, all through XML and AS 3.0 code. Basically what I want is to have several events inside a movieclip which I will incorporate into a scroll pane when I'm done, for now I'll focus on extracting data from the XML file and parsing it with AS 3.0. The layout is simple: a thumbnail image on the left, and beside it on the right there is the title of the event, its date and some info about it and all of these should have a dark grey background while the text is in white. Each two events are 30 pixels apart and there are 5 events for now.
Ok enough talking now let's get to the code:
XML Code:
<?xml version="1.0" encoding="utf-8"?>
<EVENTSXML>
<EVENT>
<TITLE> Event 1</TITLE>
<DATE>12/04/2009</DATE>
<THUMB>thumb0.jpg</THUMB>
<INFO> Some Text Goes Here </INFO>
</EVENT>
<EVENT>
<TITLE>Event 2</TITLE>
<DATE>03/02/2009</DATE>
<THUMB>thumb1.jpg</THUMB>
<INFO>Some Text Goes Here</INFO>
</EVENT>
<EVENT>
<TITLE>Event 3</TITLE>
<DATE>18/11/2008</DATE>
<THUMB>thumb2.jpg</THUMB>
<INFO>Some Text Goes Here</INFO>
</EVENT>
<EVENT>
<TITLE>Event 4</TITLE>
<DATE>10/09/2008</DATE>
<THUMB>thumb3.jpg</THUMB>
<INFO>Some Text Goes Here</INFO>
</EVENT>
<EVENT>
<TITLE>Event 5</TITLE>
<DATE>06/08/2008</DATE>
<THUMB>thumb4.jpg</THUMB>
<INFO>Some Text Goes Here</INFO>
</EVENT>
</EVENTSXML>
Actionscript 3.0 Code:
var myXML:XML;
var req:URLRequest = new URLRequest("events.xml");
var ldr:URLLoader = new URLLoader();
ldr.load(req);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
myXML = new XML(e.target.data);
buildEvents(myXML.EVENT);
var eventScroll:MovieClip = new MovieClip();
var padding:Number = 30;
this.addChild(eventScroll);
eventScroll.x = eventScroll.y = padding;
function buildEvents(evnts:XMLList):void
for(var i:uint = 0; i <evnts.length(); i++) {
var eventData:MovieClip = new MovieClip();
eventData.y = (20 + padding) * i;
eventData.itemNum = i;
eventData.title = evnts[i].TITLE;
eventData.date = evnts[i].DATE;
eventData.thumb = evnts[i].THUMB;
eventData.info = evnts[i].INFO;
// thumb container
thisThumb:Sprite = new Sprite();
var ldr:Loader = new Loader()
var req:URLRequest = new URLRequest(eventData.thumb);
ldr.load(req);
thisThumb.addChild(ldr);
eventData.addChild(thisThumb);
eventScroll.addChild(eventData);
now I am stuck there... the application is not done yet and when I publish the file I keep getting errors, these are the errors:
1067: Implicit coercion of a value of type flash.display:Sprite to an unrelated type Class.
Source: thisThumb:Sprite = new Sprite();
1188: Illegal assignment to class Sprite.
Source: thisThumb:Sprite = new Sprite();
1120: Access of undefined property thisThumb.
Source: thisThumb.addChild(ldr);
1120: Access of undefined property thisThumb.
Source: eventData.addChild(thisThumb);
1119: Access of possibly undefined property contentLoaderInfo through a reference with static type flash.net:URLLoader.
Source: ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, processXML);
So where did I go wrong and how can I carry on with my code to finish my application?
P.S: I do not want someone to do it for me, so in case someone decided to help me out, please comment and explain your code because this application is for learning porpuses in the first place... Thanks in advance!oh I've just noticed one little problem, in my info field, the text doesn't break and start a new line, it just keeps going horizontally although I've set it to multiline and gave it a width and height... so what shall I do to fix this problem? here's the code:
var infoF:TextField = new TextField();
          infoF.text = eventData.info;
          infoF.x = 250;
          infoF.y = dateF.y + padding;
          infoF.multiline = true;
          infoF.width = 200;
          infoF.height = 100;
          addChild(infoF); -
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 -
Help with lightbox gallery widget
Hello
I built a website for my photography business and used the lightbox gallery widget. I'm not massively HTML minded so I tend to build in design view and just tweak the HTML code.
The gallery is here: http://www.emmarichards.co.uk/gallery.html
When you click on one of the photos, it is not working properly, it just takes you to another webpage with just the image. It worked fine in the live view. I'm looking at it in IE, not sure which version but a fairly up to date one I think. I've also checked it using the Mozilla browser and having the same problem. How can I rectify this please? The pages code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Barnsley Wedding Photographer - Emma Richards</title>
<style type="text/css">
<!--
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background: #4E5869;
margin: 0;
padding: 0;
color: #000;
background-color: #99BADB;
/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
padding: 0;
margin: 0;
h1, h2, h3, h4, h5, h6, p {
margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
padding-right: 15px;
padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
border: none;
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
color:#414958;
text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
a:visited {
color: #4E5869;
text-decoration: underline;
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
text-decoration: none;
background-color: #FFFFFF;
/* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */
.container {
width: 80%;
max-width: 1260px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */
background: #FFF;
margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */
/* ~~the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo~~ */
.header {
background-color: #ffffff;
/* ~~ This is the layout information. ~~
1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.
.content {
padding: 10px 0;
/* ~~ This grouped selector gives the lists in the .content area space ~~ */
.content ul, .content ol {
padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
/* ~~ The footer ~~ */
.footer {
padding: 10px 0;
background-color: #ffffff;
/* ~~ miscellaneous float/clear classes ~~ */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
float: left;
margin-right: 8px;
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
-->
</style>
<script src="scripts/jquery.js" type="text/javascript"></script>
<script src="scripts/lightbox.js" type="text/javascript"></script>
<link href="css/lightbox.css" rel="stylesheet" type="text/css" />
<link href="css/sample_lightbox_layout.css" rel="stylesheet" type="text/css" />
<style type="text/css">
/* BeginOAWidget_Instance_2127022: #gallery */
.lbGallery {
/*gallery container settings*/
background-color: #ffffff;
padding-left: 180px;
padding-top: 20px;
padding-right: 180px;
padding-bottom: 20px;
width: 900px;
height: auto;
text-align:center;
.lbGallery ul { list-style: none; margin:0;padding:0; }
.lbGallery ul li { display: inline;margin:0;padding:0; }
.lbGallery ul li a{text-decoration:none;}
.lbGallery ul li a img {
/*border color, width and margin for the images*/
border-color: #ffffff;
border-left-width: 0px;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
margin-left:5px;
margin-right:5px;
margin-top:5px;
margin-bottom:5px:
.lbGallery ul li a:hover img {
/*background color on hover*/
border-color: #ffffff;
border-left-width: 0px;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
#lightbox-container-image-box {
border-top: 0px none #ffffff;
border-right: 0px none #ffffff;
border-bottom: 0px none #ffffff;
border-left: 0px none #ffffff;
#lightbox-container-image-data-box {
border-top: 0px;
border-right: 0px none #ffffff;
border-bottom: 0px none #ffffff;
border-left: 0px none #ffffff;
/* EndOAWidget_Instance_2127022 */
</style>
<script type="text/xml">
<!--
<oa:widgets>
<oa:widget wid="2127022" binding="#gallery" />
</oa:widgets>
-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<div class="container">
<div class="header">
<div align="center">
<p><img src="1title 2.png" alt="emma richards barnsley wedding photographer" width="1144" height="368" /></p>
<p><a href="about.html"><img src="1.png" alt="about emma richards barnsley wedding photographer" width="143" height="46" border="0" /></a><a href="weddings.html"><img src="1.weddings.png" alt="weddings information barnsley photographer" width="162" height="46" border="0" /></a><a href="gallery.html"><img src="1.gallery.png" alt="barnsley wedding photographer image gallery" width="162" height="46" border="0" /></a><a href="pricing.html"><img src="1.pricing.png" alt="barnsley wedding photographer pricing information" width="162" height="46" border="0" /></a><a href="engagements.html"><img src="1.engage.png" alt="engagement photography couples shoot barnsley" width="221" height="46" border="0" /></a><a href="http://emmarichardsuk.blogspot.com"><img src="1 blgo.png" alt="emma richards wedding photography blog" width="105" height="45" border="0" /></a><a href="contact.html"><img src="1 contact.png" alt="contact emma richards" width="162" height="46" border="0" /></a></p>
</div>
<!-- end .header --></div>
<div class="content">
<div id="gallery" class="lbGallery">
<div align="center">
<ul>
<li> <a href="2.ABBIE AND KID.jpg" width="600" height="400" title=""><img src="2.ABBIE AND KID.jpg" width="150" height="100" alt="barnsley wedding photography" /></a>
<li> <a href="2.R AND M CUTTING CAKE.jpg" title=""><img src="2.R AND M CUTTING CAKE.jpg" width="150" height="100" alt="Park Inn wedding" "wath" "barnsley" "photography" /></a>
<li> <a href="alex laura 1 (5).jpg" title=""><img src="alex laura 1 (5).jpg" width="150" height="100" alt="barnsley wedding photographer" /></a>
<li> <a href="alex laura 1 (8).jpg"><img src="alex laura 1 (8).jpg" width="150" height="100" alt="whitley hall wedding" "sheffield" "barnsley wedding photographer" "reception" /></a> </li>
<li> <a href="tree closer.jpg" width="600px" height="400px" title=""><img src="tree closer.jpg" width="150" height="100" alt="" /></a> </li><br />
<li> <a href="11.jpg" width="600" height="400" title=""><img src="11.jpg" width="150" height="100" alt="barnsley wedding photography" /></a>
<li> <a href="10.jpg" title=""><img src="10.jpg" width="150" height="100" alt="barnsley wedding photography" /></a>
<li> <a href="James Ruth Church128.jpg" title=""><img src="James Ruth Church128.jpg" width="150" height="100" alt="whitley hall wedding" "sheffield" "barnsley wedding photographer" "reception" /></a>
<li> <a href="2.ABBIE GROUP.jpg"><img src="2.ABBIE GROUP.jpg" width="150" height="100" alt="barnsley wedding photographer" /></a> </li>
<li> <a href="12-5.jpg" width="600px" height="400px" title=""><img src="12-5.jpg" width="150" height="100" alt="barnsley wedding photography" /></a> </li><br />
<li> <a href="alex laura 1 (3).jpg" width="600" height="400" title=""><img src="alex laura 1 (3).jpg" width="150" height="100" alt="barnsley wedding photography" /></a>
<li> <a href="confetti crop.jpg" title=""><img src="confetti crop.jpg" width="150" height="100" alt="barnsley wedding photographer" /></a>
<li> <a href="Mark & Rachel 025.jpg" title=""><img src="Mark & Rachel 025.jpg" width="150" height="100" alt="park inn wedding" "wath" "barnsley" "photography" /></a>
<li> <a href="Abbie Ben 0336.jpg"><img src="Abbie Ben 0336.jpg" width="150" height="100" alt="barnsley wedding photographer" /></a> </li>
<li> <a href="Abbie Ben 0309.jpg" width="600px" height="400px" title=""><img src="Abbie Ben 0309.jpg" width="150" height="100" alt="barnsley wedding photographer" "first kiss" /></a> </li><br />
<li> <a href="laughing 2.png" width="600" height="400" title=""><img src="laughing 2.png" width="150" height="100" alt="whitley hall wedding" "sheffield wedding photography" /></a>
<li> <a href="2.double.jpg" title=""><img src="2.double.jpg" width="150" height="100" alt="Park Inn wedding" "wath" "barnsley" "photography" /></a>
<li> <a href="132.jpg" title=""><img src="132.jpg" width="150" height="100" alt="whitley hall wedding" "sheffield" "barnsley wedding photographer" "reception" /></a>
<li> <a href="Abbie and Ben 0621.jpg"><img src="Abbie and Ben 0621.jpg" width="150" height="100" alt="barnsley wedding photography" /></a> </li>
<li> <a href="Abbie Ben 0320.jpg" width="600px" height="400px" title=""><img src="Abbie Ben 0320.jpg" width="150" height="100" alt="barnsley wedding photography" /></a> </li><br />
<li> <a href="Abbie Ben 0011 copy.jpg" width="600" height="400" title=""><img src="Abbie Ben 0011 copy.jpg" width="150" height="100" alt="bouquet" "barnsley wedding photographer" /></a>
<li> <a href="James & Ruth0202.jpg" title=""><img src="James & Ruth0202.jpg" width="150" height="100" alt="barnsley wedding photographer" /></a>
<li> <a href="alex laura 1 (4).jpg" title=""><img src="alex laura 1 (4).jpg" width="150" height="100" alt="barnsley wedding photographer" /></a>
<li> <a href="123.jpg"><img src="123.jpg" width="150" height="100" alt="rotherham" "park inn wedding" "wath" "barnsley" "photography" /></a> </li>
<li> <a href="Mark & Rachel 311.jpg" width="600px" height="400px" title=""><img src="Mark & Rachel 311.jpg" width="150" height="100" alt= "rotherham" "Park Inn wedding" "wath" "barnsley" "photography" /></a> </li><br />
</ul>
</div>
</div>
<div align="center">
<script type="text/javascript">
// BeginOAWidget_Instance_2127022: #gallery
$(function(){
$('#gallery a').lightBox({
imageLoading: '/images/lightbox/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
imageBtnPrev: '/images/lightbox/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
imageBtnNext: '/images/lightbox/lightbox-btn-next.gif', // (string) Path and the name of the next button image
imageBtnClose: '/images/lightbox/lightbox-btn-close.gif', // (string) Path and the name of the close btn
imageBlank: '/images/lightbox/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)
fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
containerResizeSpeed: 400, // Specify the resize duration of container image. These number are miliseconds. 400 is default.
overlayBgColor: "#ffffff", // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
overlayOpacity: 0, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
txtImage: 'Image', //Default text of image
txtOf: 'of'
// EndOAWidget_Instance_2127022
</script><!-- end .content --></div>
</div>
<div class="footer">
<hr />
<p align="right" class="container">07794 430 229 // [email protected]</p>
<!-- end .footer --></div>
<!-- end .container --></div>
</body>
</html>emmarichards4 wrote:
Do I need to have the same path as in my root folder, so for example within my Public folder with my host, have a 'script's folder and then put the 'jquery.js' file within that or should that not matter?
All paths (the route from the parent file to the dependent file) are crucial.
If the path is not correct, the required file will not be found and the effect will not work.
There's no need to upload files individually and manually place them into remote folders. DW handles all file and folder paths for you if you use the Files panel.
For example, http://www.emmarichards.co.uk/scripts/lightbox.js = 404 error. The file still does not exist on the server in that location.
You should be able to click on the css and scripts folders locally, click Put and all files in those folders will be uploaded correctly. -
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. -
Help with XML - which is better - Help needed
Current version of Oracle:
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
I'm new to XML & this is my first post.
Background: I have a "few" relational tables which are designed to assist the form scraping and to store the values as Key-Value-Attribute from the UI capture. (the change to the design is not possible at this time). I've also built the "normalized" schema which will hold the normalized data from this form-scrapping schema.
In order to achive this: I plan on having (1) XML view which the UI will call and then it will be inserted/updated in the normalized schema (2) to be able to use the same XML by the BI publisher for reporting (3) end user query this form-scraping db to view as normalized data.
Following are my thoughts about the approach & please correct & guide if my understanding/approach is wrong.
After some good reading on this forum and other materials, I've come up with the below mentioned XML generation method. How can I convert this XML "record" such that it can satisfy the above stated.
output:
<?xml version="1.0"?>
<ROWSET>
<ROW>
<FORM_TYPE_ID>900</FORM_TYPE_ID>
<SYSTEM_NAME>HAZMAT_ENROLLMENT</SYSTEM_NAME>
<FORM_TYPE>ENR-HAZMAT</FORM_TYPE>
<FORM_ID>2371370</FORM_ID>
<SUBMISSION_TYPE_ID>60</SUBMISSION_TYPE_ID>
<FILING_DATE>29-APR-11</FILING_DATE>
<SECTION>
<SECTION_ROW>
<SECTION_ID>6750</SECTION_ID>
<SECTION_NAME>Personal Information</SECTION_NAME>
<ATTRIBUTE>
<ATTRIBUTE_ROW>
<SRC>FRM_RSP</SRC>
<ATTR_ID>30001</ATTR_ID>
<ATTR_NAME>ENROLLEE_FIRST_NAME</ATTR_NAME>
<ATTR_DESC>Enrollee's First Name</ATTR_DESC>
<ATTR_VAL>Test First Name</ATTR_VAL>
</ATTRIBUTE_ROW>
<ATTRIBUTE_ROW>
<SRC>FRM_RSP</SRC>
<ATTR_ID>30002</ATTR_ID>
<ATTR_NAME>ENROLLEE_MIDDLE_INIT</ATTR_NAME>
<ATTR_DESC>Enrollee's Middle Initial</ATTR_DESC>
<ATTR_VAL>Test Middle Initial</ATTR_VAL>
</ATTRIBUTE_ROW>
</SECTION_ROW>
</SECTION>
</ROW>
</ROWSET>
Code:
*(All REF_% tables are lookup and FRM_RESPONSE is a KVA capture table and TBL_RESPONSE is also a KVA capture only used if the input is table wise (rows X columns))*
FORM is made up of SECTIONs (1-to-many), SECTIONs contain ATTR_IDs (question ids, 1-to-many), %RESPONSE is always linked to an ATTR_ID
CREATE OR REPLACE function DEVDBA.gen_xmlstr (p_form_id form.form_id%type) return clob as
str clob := '
SELECT rft.form_type_id, rft.system_name,rft.form_type, f.form_id, f.submission_type_id, f.sp_id,
f.filing_date, f.tracking_num, f.spplmntl_num, f.parent_form_id, f.created_date, f.created_by,
f.updated_date, f.updated_by,
CURSOR(SELECT rs.section_id,
rs.section_name,
CURSOR(SELECT ''FRM_RSP'' src, fr.frm_response_id, ra.attr_id, ra.attr_name, ra.attr_desc, fr.attr_val
FROM frm_response fr, ref_attr ra, ref_section_attr rsa
WHERE fr.form_id = f.form_id
AND fr.attr_id = rsa.attr_id
AND fr.form_section_id = rsa.form_section_id
AND fr.attr_id = ra.attr_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP1'' src, tr.tbl_response_id, tr.col_attr_id1, ra.attr_name, ra.attr_desc, col_attr_val1
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id1 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP2'' src, tr.tbl_response_id, tr.col_attr_id2, ra.attr_name, ra.attr_desc, col_attr_val2
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id2 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP3'' src, tr.tbl_response_id, TO_NUMBER(tr.col_attr_id3), ra.attr_name, ra.attr_desc, col_attr_val3
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND TO_NUMBER(tr.col_attr_id3) = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP4'' src, tr.tbl_response_id, tr.col_attr_id4, ra.attr_name, ra.attr_desc, col_attr_val4
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id4 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP5'' src, tr.tbl_response_id, tr.col_attr_id5, ra.attr_name, ra.attr_desc, col_attr_val5
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id5 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP6'' src, tr.tbl_response_id, tr.col_attr_id6, ra.attr_name, ra.attr_desc, col_attr_val6
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id6 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP7'' src, tr.tbl_response_id, tr.col_attr_id7, ra.attr_name, ra.attr_desc, col_attr_val7
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id7 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP8'' src, tr.tbl_response_id, tr.col_attr_id8, ra.attr_name, ra.attr_desc, col_attr_val8
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id8 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP9'' src, tr.tbl_response_id, tr.col_attr_id9, ra.attr_name, ra.attr_desc, col_attr_val9
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id9 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
UNION
SELECT ''TBL_RSP10'' src, tr.tbl_response_id, tr.col_attr_id10, ra.attr_name, ra.attr_desc, col_attr_val10
FROM tbl_response tr, ref_attr ra, ref_section_attr rsa
WHERE tr.form_id = f.form_id
AND tr.col_attr_id10 = ra.attr_id
AND tr.form_section_id = rsa.form_section_id
AND rsa.form_section_id = rfs.form_section_id
attribute
FROM ref_section rs, ref_form_section rfs
WHERE rs.section_id = rfs.section_id
AND rfs.form_type_id = f.form_type_id
ORDER BY rs.section_id, rfs.form_section_id)
section
FROM ref_form_type rft, form f
WHERE rft.form_type_id = f.form_type_id
AND f.form_id = ' || p_form_id; --2371370'';
begin
return dbms_xmlgen.getxml(str);
end gen_xmlstr;
Invocation:
select gen_xmlstr(2371370)
from dual;
Below is the execution plan. Can this be better?
Execution Plan
Plan hash value: 2652539008
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 75 | 3 (0)| 00:00:01 |
| 1 | SORT UNIQUE | | 11 | 1024 | 40 (88)| 00:00:01 |
| 2 | UNION-ALL | | | | | |
| 3 | NESTED LOOPS | | | | | |
| 4 | NESTED LOOPS | | 1 | 91 | 5 (0)| 00:00:01 |
| 5 | NESTED LOOPS | | 1 | 82 | 3 (0)| 00:00:01 |
|* 6 | TABLE ACCESS BY INDEX ROWID| FRM_RESPONSE | 1 | 25 | 2 (0)| 00:00:01 |
|* 7 | INDEX RANGE SCAN | FK3_FRM_RESPONSE | 20 | | 1 (0)| 00:00:01 |
| 8 | TABLE ACCESS BY INDEX ROWID| REF_ATTR | 1 | 57 | 1 (0)| 00:00:01 |
|* 9 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
|* 10 | INDEX RANGE SCAN | FK2_REF_SECTION_ATTR | 2 | | 1 (0)| 00:00:01 |
|* 11 | TABLE ACCESS BY INDEX ROWID | REF_SECTION_ATTR | 1 | 9 | 2 (0)| 00:00:01
| 12 | NESTED LOOPS | | | | | |
| 13 | NESTED LOOPS | | 1 | 105 | 2 (0)| 00:00:01 |
| 14 | NESTED LOOPS | | 1 | 48 | 2 (0)| 00:00:01 |
|* 15 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 16 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 44 | 1 (0)| 00:00:01 |
|* 17 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 18 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 19 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 20 | NESTED LOOPS | | | | | |
| 21 | NESTED LOOPS | | 1 | 100 | 2 (0)| 00:00:01 |
| 22 | NESTED LOOPS | | 1 | 43 | 2 (0)| 00:00:01 |
|* 23 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 24 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 39 | 1 (0)| 00:00:01 |
|* 25 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 26 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 27 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 28 | NESTED LOOPS | | | | | |
| 29 | NESTED LOOPS | | 1 | 86 | 3 (0)| 00:00:01 |
| 30 | NESTED LOOPS | | 1 | 29 | 2 (0)| 00:00:01 |
|* 31 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 32 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 25 | 1 (0)| 00:00:01 |
|* 33 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 34 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 35 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 1 (0)| 00:00:01 |
| 36 | NESTED LOOPS | | | | | |
| 37 | NESTED LOOPS | | 1 | 93 | 2 (0)| 00:00:01 |
| 38 | NESTED LOOPS | | 1 | 36 | 2 (0)| 00:00:01 |
|* 39 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 40 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 32 | 1 (0)| 00:00:01 |
|* 41 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 42 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 43 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 44 | NESTED LOOPS | | | | | |
| 45 | NESTED LOOPS | | 1 | 93 | 2 (0)| 00:00:01 |
| 46 | NESTED LOOPS | | 1 | 36 | 2 (0)| 00:00:01 |
|* 47 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 48 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 32 | 1 (0)| 00:00:01 |
|* 49 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 50 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 51 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 52 | NESTED LOOPS | | | | | |
| 53 | NESTED LOOPS | | 1 | 90 | 2 (0)| 00:00:01 |
| 54 | NESTED LOOPS | | 1 | 33 | 2 (0)| 00:00:01 |
|* 55 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 56 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 29 | 1 (0)| 00:00:01 |
|* 57 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 58 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 59 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 60 | NESTED LOOPS | | | | | |
| 61 | NESTED LOOPS | | 1 | 95 | 2 (0)| 00:00:01 |
| 62 | NESTED LOOPS | | 1 | 38 | 2 (0)| 00:00:01 |
|* 63 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 64 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 34 | 1 (0)| 00:00:01 |
|* 65 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 66 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 67 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 68 | NESTED LOOPS | | | | | |
| 69 | NESTED LOOPS | | 1 | 90 | 2 (0)| 00:00:01 |
| 70 | NESTED LOOPS | | 1 | 33 | 2 (0)| 00:00:01 |
|* 71 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 72 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 29 | 1 (0)| 00:00:01 |
|* 73 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 74 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 75 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 76 | NESTED LOOPS | | | | | |
| 77 | NESTED LOOPS | | 1 | 90 | 2 (0)| 00:00:01 |
| 78 | NESTED LOOPS | | 1 | 33 | 2 (0)| 00:00:01 |
|* 79 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 80 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 29 | 1 (0)| 00:00:01 |
|* 81 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 82 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 83 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 84 | NESTED LOOPS | | | | | |
| 85 | NESTED LOOPS | | 1 | 91 | 2 (0)| 00:00:01 |
| 86 | NESTED LOOPS | | 1 | 34 | 2 (0)| 00:00:01 |
|* 87 | INDEX RANGE SCAN | FK1_REF_SECTION_ATTR | 9 | 36 | 1 (0)| 00:00:01 |
|* 88 | TABLE ACCESS BY INDEX ROWID| TBL_RESPONSE | 1 | 30 | 1 (0)| 00:00:01 |
|* 89 | INDEX RANGE SCAN | FK1_TBL_RESPONSE | 1 | | 0 (0)| 00:00:01 |
|* 90 | INDEX UNIQUE SCAN | PK_REF_ATTR | 1 | | 0 (0)| 00:00:01 |
| 91 | TABLE ACCESS BY INDEX ROWID | REF_ATTR | 1 | 57 | 0 (0)| 00:00:01 |
| 92 | SORT ORDER BY | | 20 | 1040 | 7 (29)| 00:00:01 |
|* 93 | HASH JOIN | | 20 | 1040 | 6 (17)| 00:00:01 |
| 94 | TABLE ACCESS BY INDEX ROWID | REF_FORM_SECTION | 20 | 200 | 2 (0)| 00:00:01 |
|* 95 | INDEX RANGE SCAN | FK1_FORM_SECTION | 20 | | 1 (0)| 00:00:01 |
| 96 | TABLE ACCESS FULL | REF_SECTION | 100 | 4200 | 3 (0)| 00:00:01 |
| 97 | NESTED LOOPS | | 1 | 75 | 3 (0)| 00:00:01 |
| 98 | TABLE ACCESS BY INDEX ROWID | FORM | 1 | 59 | 2 (0)| 00:00:01 |
|* 99 | INDEX UNIQUE SCAN | PK_FORM | 1 | | 1 (0)| 00:00:01 |
| 100 | TABLE ACCESS BY INDEX ROWID | REF_FORM_TYPE | 5 | 80 | 1 (0)| 00:00:01 |
|*101 | INDEX UNIQUE SCAN | PK_REF_FORM_TYPE | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
6 - filter("FR"."FORM_SECTION_ID"=:B1)
7 - access("FR"."FORM_ID"=:B1)
9 - access("FR"."ATTR_ID"="RA"."ATTR_ID")
10 - access("FR"."ATTR_ID"="RSA"."ATTR_ID")
11 - filter("RSA"."FORM_SECTION_ID"=:B1 AND "FR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
15 - access("RSA"."FORM_SECTION_ID"=:B1)
16 - filter("TR"."COL_ATTR_ID1" IS NOT NULL AND "TR"."FORM_ID"=:B1)
17 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
18 - access("TR"."COL_ATTR_ID1"="RA"."ATTR_ID")
23 - access("RSA"."FORM_SECTION_ID"=:B1)
24 - filter("TR"."COL_ATTR_ID2" IS NOT NULL AND "TR"."FORM_ID"=:B1)
25 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
26 - access("TR"."COL_ATTR_ID2"="RA"."ATTR_ID")
31 - access("RSA"."FORM_SECTION_ID"=:B1)
32 - filter("TR"."FORM_ID"=:B1)
33 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
34 - access("RA"."ATTR_ID"=TO_NUMBER("TR"."COL_ATTR_ID3"))
39 - access("RSA"."FORM_SECTION_ID"=:B1)
40 - filter("TR"."COL_ATTR_ID4" IS NOT NULL AND "TR"."FORM_ID"=:B1)
41 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
42 - access("TR"."COL_ATTR_ID4"="RA"."ATTR_ID")
47 - access("RSA"."FORM_SECTION_ID"=:B1)
48 - filter("TR"."COL_ATTR_ID5" IS NOT NULL AND "TR"."FORM_ID"=:B1)
49 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
50 - access("TR"."COL_ATTR_ID5"="RA"."ATTR_ID")
55 - access("RSA"."FORM_SECTION_ID"=:B1)
56 - filter("TR"."COL_ATTR_ID6" IS NOT NULL AND "TR"."FORM_ID"=:B1)
57 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
58 - access("TR"."COL_ATTR_ID6"="RA"."ATTR_ID")
63 - access("RSA"."FORM_SECTION_ID"=:B1)
64 - filter("TR"."COL_ATTR_ID7" IS NOT NULL AND "TR"."FORM_ID"=:B1)
65 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
66 - access("TR"."COL_ATTR_ID7"="RA"."ATTR_ID")
71 - access("RSA"."FORM_SECTION_ID"=:B1)
72 - filter("TR"."COL_ATTR_ID8" IS NOT NULL AND "TR"."FORM_ID"=:B1)
73 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
74 - access("TR"."COL_ATTR_ID8"="RA"."ATTR_ID")
79 - access("RSA"."FORM_SECTION_ID"=:B1)
80 - filter("TR"."COL_ATTR_ID9" IS NOT NULL AND "TR"."FORM_ID"=:B1)
81 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
82 - access("TR"."COL_ATTR_ID9"="RA"."ATTR_ID")
87 - access("RSA"."FORM_SECTION_ID"=:B1)
88 - filter("TR"."COL_ATTR_ID10" IS NOT NULL AND "TR"."FORM_ID"=:B1)
89 - access("TR"."FORM_SECTION_ID"=:B1)
filter("TR"."FORM_SECTION_ID"="RSA"."FORM_SECTION_ID")
90 - access("TR"."COL_ATTR_ID10"="RA"."ATTR_ID")
93 - access("RS"."SECTION_ID"="RFS"."SECTION_ID")
95 - access("RFS"."FORM_TYPE_ID"=:B1)
99 - access("F"."FORM_ID"=2371370)
101 - access("RFT"."FORM_TYPE_ID"="F"."FORM_TYPE_ID")
What tools/techniques are available to generate the XSLT? (use XMLSpy etc?), how to create a such that it can be as simple as "select from v_xml_view;" and be able to replace * with column names?*
==============================
I've also tried the *SQL-XML extensions* but am stuck with the UNION PART (help is requested on how to union columns within the XMLAgg).
{code}
select
xmlelement ("System",
xmlforest(rft.form_type_id as "FormTypeID", rft.system_name as "SystemName", rft.form_type as "FormType", f.form_id as "FormID"),
xmlelement("Sections",
(select xmlagg(xmlelement("Section",
xmlforest(rs.section_id as "SectionID", rs.section_name as "SectionName"),
xmlelement("Attributes",
(select xmlagg(xmlelement("Attr",
xmlforest (rsa.attr_id as "AttrID", ra.attr_name as "AttrName", ra.attr_desc as "Attr_desc", fr.attr_val as "AttrValue")
) -- "attr"
) --xmlagg attr
from ref_section_attr rsa, ref_attr ra, frm_response fr
where rsa.attr_id = ra.attr_id
and rsa.form_section_id = rfs.form_section_id
and fr.form_id = f.form_id
and fr.form_section_id = rsa.form_section_id
and fr.attr_id = rsa.attr_id
) --attributes select
) -- attributes
) -- section elements
) -- xmlagg
from ref_section rs, ref_form_section rfs
where rs.section_id = rfs.section_id
and rfs.form_type_id = f.form_type_id
) -- select query
) -- sections
) -- system
as str
from ref_form_type rft, FORM f
where rft.form_type_id = f.form_type_id
and f.form_id = 2371420;
{code}
*and the output is like:
(I don't know how to format this for easy viewing!)*
{code}
<System><FormTypeID>900</FormTypeID><SystemName>HAZMAT_ENROLLMENT</SystemName><FormType>ENR-HAZMAT</FormType><FormID>2371420</FormID><Sections><Section><SectionID>6750</SectionID><SectionName>Personal Information</SectionName><Attributes><Attr><AttrID>30001</AttrID><AttrName>ENROLLEE_FIRST_NAME</AttrName><Attr_desc>Enrollee's First Name</Attr_desc><AttrValue>Enroll</AttrValue></Attr><Attr><AttrID>30002</AttrID><AttrName>ENROLLEE_MIDDLE_INIT</AttrName><Attr_desc>Enrollee's Middle Initial</Attr_desc><AttrValue> </AttrValue></Attr><Attr><AttrID>30003</AttrID><AttrName>ENROLLEE_LAST_NAME</AttrName><Attr_desc>Enrollee's Last Name</Attr_desc><AttrValue>User11</AttrValue></Attr><Attr><AttrID>30004</AttrID><AttrName>ENROLLEE_WORK_PHONE</AttrName><Attr_desc>Enrollee's Work Phone Number</Attr_desc><AttrValue>(703) 222-4444</AttrValue></Attr><Attr><AttrID>30005</AttrID><AttrName>ENROLLEE_FAX</AttrName><Attr_desc>Enrollee Fax Number</Attr_desc><AttrValue> </AttrValue></Attr><Attr><AttrID>30006</AttrID><AttrName>ENROLLEE_EXT</AttrName><Attr_desc>Enrollee's Work Extension</Attr_desc><AttrValue> </AttrValue></Attr><Attr><AttrID>30007</AttrID><AttrName>ENROLLEE_EMAIL</AttrName><Attr_desc>Enrollee's Email</Attr_desc><AttrValue>[email protected]</AttrValue></Attr><Attr><AttrID>30023</AttrID><AttrName>POC_TYPE</AttrName><Attr_desc>Point of Contact Type</Attr_desc><AttrValue>Consultant</AttrValue></Attr><Attr><AttrID>30008</AttrID><AttrName>ENROLLEE_MAIL_ADDR_1</AttrName><Attr_desc>Enrollee's Mailing Address #1</Attr_desc><AttrValue>123 Main St</AttrValue></Attr><Attr><AttrID>30009</AttrID><AttrName>ENROLLEE_MAIL_ADDR_2</AttrName><Attr_desc>Enrollee's Mailing Address #2</Attr_desc><AttrValue> </AttrValue></Attr><Attr><AttrID>30010</AttrID><AttrName>ENROLLEE_CITY</AttrName><Attr_desc>Enrollee's City</Attr_desc><AttrValue>Herndon</AttrValue></Attr><Attr><AttrID>30011</AttrID><AttrName>ENROLLEE_STATE</AttrName><Attr_desc>Enrollee's State</Attr_desc><AttrValue>VA</AttrValue></Attr><Attr><AttrID>30012</AttrID><AttrName>ENROLLEE_ZIP</AttrName><Attr_desc>Enrollee's Zip</Attr_desc><AttrValue>28408</AttrValue></Attr><Attr><AttrID>30013</AttrID><AttrName>ENROLLEE_USER_NAME</AttrName><Attr_desc>Enrollee's User Name</Attr_desc><AttrValue>enrolluser11</AttrValue></Attr></Attributes></Section><Section><SectionID>6800</SectionID><SectionName>Company Information</SectionName><Attributes><Attr><AttrID>30014</AttrID><AttrName>DUN_BRADSTREET_NUM</AttrName><Attr_desc>Company's Dun and Bradstreet #</Attr_desc><AttrValue>198455201</AttrValue></Attr></Attributes></Section><Section><SectionID>6850</SectionID><SectionName>Points of Contact</SectionName><Attributes></Attributes></Section><Section><SectionID>6900</SectionID><SectionName>Enrollment Verification</SectionName><Attributes></Attributes></Section><Section><SectionID>6950</SectionID><SectionName>Enrollment Confirmation</SectionName><Attributes></Attributes></Section></Sections></System>
{code}
*The execution plan:*
{code}
Execution Plan
Plan hash value: 2641045985
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------Thanks for the data.
I thought you would have included data from TBL_RESPONSE, as the interesting part is how to deal with this "special" design ;)
So, to run some tests, I've generated the following data for FORM_SECTION_ID 5350 and 5360 :
insert into tbl_response (FORM_ID, FORM_SECTION_ID, COL_ATTR_ID1, COL_ATTR_VAL1, COL_ATTR_ID2, COL_ATTR_VAL2, COL_ATTR_ID3, COL_ATTR_VAL3, COL_ATTR_ID4, COL_ATTR_VAL4, COL_ATTR_ID5, COL_ATTR_VAL5, COL_ATTR_ID6, COL_ATTR_VAL6, COL_ATTR_ID7, COL_ATTR_VAL7, COL_ATTR_ID8, COL_ATTR_VAL8, COL_ATTR_ID9, COL_ATTR_VAL9, COL_ATTR_ID10, COL_ATTR_VAL10)
values (2371420, 5350, 30000, '05/03/2011', 30001, 'John', '30002', 'J', 30003, 'Doe', 30004, '(555) 123-1234', 30005, '(555) 123-1235', 30006, '1234567', 30007, '[email protected]', 30008, '10 Maple Street', 30009, '.');
insert into tbl_response (FORM_ID, FORM_SECTION_ID, COL_ATTR_ID1, COL_ATTR_VAL1, COL_ATTR_ID2, COL_ATTR_VAL2, COL_ATTR_ID3, COL_ATTR_VAL3, COL_ATTR_ID4, COL_ATTR_VAL4, COL_ATTR_ID5, COL_ATTR_VAL5, COL_ATTR_ID6, COL_ATTR_VAL6, COL_ATTR_ID7, COL_ATTR_VAL7, COL_ATTR_ID8, COL_ATTR_VAL8, COL_ATTR_ID9, COL_ATTR_VAL9, COL_ATTR_ID10, COL_ATTR_VAL10)
values (2371420, 5350, 30011, 'MA', 30012, '02668', '30013', 'jdoe', null, '', null, '', null, '', null, '', null, '', null, '', null, '');
insert into tbl_response (FORM_ID, FORM_SECTION_ID, COL_ATTR_ID1, COL_ATTR_VAL1, COL_ATTR_ID2, COL_ATTR_VAL2, COL_ATTR_ID3, COL_ATTR_VAL3, COL_ATTR_ID4, COL_ATTR_VAL4, COL_ATTR_ID5, COL_ATTR_VAL5, COL_ATTR_ID6, COL_ATTR_VAL6, COL_ATTR_ID7, COL_ATTR_VAL7, COL_ATTR_ID8, COL_ATTR_VAL8, COL_ATTR_ID9, COL_ATTR_VAL9, COL_ATTR_ID10, COL_ATTR_VAL10)
values (2371420, 5360, 30014, '123456789', 30015, 'My Company', '30016', '50 Main Street', 30017, '.', 30018, 'Marstons Mills', 30019, 'MA', 30020, '02648', 30021, '(555) 123-1236', null, '', null, '');And here's the query :
WITH attr_unpivot AS (
SELECT form_section_id
, attr_val
FROM (
SELECT form_section_id
, XMLForest(col_attr_id1 as "AttrID", col_attr_val1 as "AttrValue") as attr01
, XMLForest(col_attr_id2 as "AttrID", col_attr_val2 as "AttrValue") as attr02
, XMLForest(col_attr_id3 as "AttrID", col_attr_val3 as "AttrValue") as attr03
, XMLForest(col_attr_id4 as "AttrID", col_attr_val4 as "AttrValue") as attr04
, XMLForest(col_attr_id5 as "AttrID", col_attr_val5 as "AttrValue") as attr05
, XMLForest(col_attr_id6 as "AttrID", col_attr_val6 as "AttrValue") as attr06
, XMLForest(col_attr_id7 as "AttrID", col_attr_val7 as "AttrValue") as attr07
, XMLForest(col_attr_id8 as "AttrID", col_attr_val8 as "AttrValue") as attr08
, XMLForest(col_attr_id9 as "AttrID", col_attr_val9 as "AttrValue") as attr09
, XMLForest(col_attr_id10 as "AttrID", col_attr_val10 as "AttrValue") as attr10
FROM tbl_response
WHERE form_id = 2371420
UNPIVOT (
attr_val FOR attr_pos IN (attr01,attr02,attr03,attr04,attr05,attr06,attr07,attr08,attr09,attr10)
UNION ALL
SELECT form_section_id
, XMLForest(fr.attr_id as "AttrID", fr.attr_val as "AttrValue")
FROM frm_response fr
WHERE fr.form_id = 2371420
SELECT XMLElement("System",
XMLForest(
rft.form_type_id as "FormTypeID"
, rft.system_name as "SystemName"
, rft.form_type as "FormType"
, f.form_id as "FormID"
, XMLElement("Sections",
SELECT XMLAgg(
XMLElement("Section",
XMLForest(
rs.section_id as "SectionID"
, rs.section_name as "SectionName"
, XMLElement("Attributes",
SELECT XMLAgg(
XMLElement("Attr",
XMLForest(
ra.attr_desc as "AttrDesc"
, ra.attr_name as "AttrName"
, v.attr_val
FROM attr_unpivot v
JOIN ref_section_attr rsa ON rsa.attr_id = extractValue(v.attr_val,'AttrID')
AND rsa.form_section_id = v.form_section_id
JOIN ref_attr ra ON ra.attr_id = rsa.attr_id
WHERE rsa.form_section_id = rfs.form_section_id
FROM ref_section rs
JOIN ref_form_section rfs ON rs.section_id = rfs.section_id
WHERE rfs.form_type_id = f.form_type_id
) as xmldoc
FROM ref_form_type rft
JOIN form f ON rft.form_type_id = f.form_type_id
WHERE f.form_id = 2371420
;The WITH clause builds a normalized result set out of TBL_RESPONSE and FRM_RESPONSE.
That result set is then joined in the main query for each section of the form.
The resulting XML document looks like :
<System>
<FormTypeID>900</FormTypeID>
<SystemName>ENROLLMENT</SystemName>
<FormType>ENR</FormType>
<FormID>2371420</FormID>
<Sections>
<Section>
<SectionID>6750</SectionID>
<SectionName>Personal Information</SectionName>
<Attributes>
<Attr>
<AttrDesc>Enrollment Date</AttrDesc>
<AttrName>ENROLLMENT_DATE</AttrName>
<AttrID>30000</AttrID>
<AttrValue>05/03/2011</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's First Name</AttrDesc>
<AttrName>ENROLLEE_FIRST_NAME</AttrName>
<AttrID>30001</AttrID>
<AttrValue>John</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's Middle Initial</AttrDesc>
<AttrName>ENROLLEE_MIDDLE_INIT</AttrName>
<AttrID>30002</AttrID>
<AttrValue>J</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's Last Name</AttrDesc>
<AttrName>ENROLLEE_LAST_NAME</AttrName>
<AttrID>30003</AttrID>
<AttrValue>Doe</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's Work Phone Number</AttrDesc>
<AttrName>ENROLLEE_WORK_PHONE</AttrName>
<AttrID>30004</AttrID>
<AttrValue>(555) 123-1234</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee Fax Number</AttrDesc>
<AttrName>ENROLLEE_FAX</AttrName>
<AttrID>30005</AttrID>
<AttrValue>(555) 123-1235</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's Work Extension</AttrDesc>
<AttrName>ENROLLEE_EXT</AttrName>
<AttrID>30006</AttrID>
<AttrValue>1234567</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's Email</AttrDesc>
<AttrName>ENROLLEE_EMAIL</AttrName>
<AttrID>30007</AttrID>
<AttrValue>[email protected]</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's Mailing Address #1</AttrDesc>
<AttrName>ENROLLEE_MAIL_ADDR_1</AttrName>
<AttrID>30008</AttrID>
<AttrValue>10 Maple Street</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's Mailing Address #2</AttrDesc>
<AttrName>ENROLLEE_MAIL_ADDR_2</AttrName>
<AttrID>30009</AttrID>
<AttrValue>.</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's State</AttrDesc>
<AttrName>ENROLLEE_STATE</AttrName>
<AttrID>30011</AttrID>
<AttrValue>MA</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's Zip</AttrDesc>
<AttrName>ENROLLEE_ZIP</AttrName>
<AttrID>30012</AttrID>
<AttrValue>02668</AttrValue>
</Attr>
<Attr>
<AttrDesc>Enrollee's User Name</AttrDesc>
<AttrName>ENROLLEE_USER_NAME</AttrName>
<AttrID>30013</AttrID>
<AttrValue>jdoe</AttrValue>
</Attr>
</Attributes>
</Section>
<Section>
<SectionID>6800</SectionID>
<SectionName>Company Information</SectionName>
<Attributes>
<Attr>
<AttrDesc>Company's DB #</AttrDesc>
<AttrName>DBNUM</AttrName>
<AttrID>30014</AttrID>
<AttrValue>123456789</AttrValue>
</Attr>
<Attr>
<AttrDesc>Company Name</AttrDesc>
<AttrID>30015</AttrID>
<AttrValue>My Company</AttrValue>
</Attr>
<Attr>
<AttrDesc>Company Adress #1</AttrDesc>
<AttrID>30016</AttrID>
<AttrValue>50 Main Street</AttrValue>
</Attr>
<Attr>
<AttrDesc>Company Adress #2</AttrDesc>
<AttrID>30017</AttrID>
<AttrValue>.</AttrValue>
</Attr>
<Attr>
<AttrDesc>Company City</AttrDesc>
<AttrID>30018</AttrID>
<AttrValue>Marstons Mills</AttrValue>
</Attr>
<Attr>
<AttrDesc>Company State</AttrDesc>
<AttrID>30019</AttrID>
<AttrValue>MA</AttrValue>
</Attr>
<Attr>
<AttrDesc>Company Zip</AttrDesc>
<AttrID>30020</AttrID>
<AttrValue>02648</AttrValue>
</Attr>
<Attr>
<AttrDesc>Company Phone</AttrDesc>
<AttrID>30021</AttrID>
<AttrValue>(555) 123-1236</AttrValue>
</Attr>
</Attributes>
</Section>
<Section>
<SectionID>6850</SectionID>
<SectionName>Points of Contact</SectionName>
<Attributes/>
</Section>
<Section>
<SectionID>6900</SectionID>
<SectionName>Enrollment Verification</SectionName>
<Attributes/>
</Section>
<Section>
<SectionID>6950</SectionID>
<SectionName>Enrollment Confirmation</SectionName>
<Attributes/>
</Section>
</Sections>
</System>
Maybe you are looking for
-
I cannot open a tab to the right of an existing tab. I've followed the directions provided under normal FAQ. This feature just recently was wiped from my PC, and I am not certain how.
-
Query returns too many results
I have this query that returns 118,900 records when I try to add or oth_tchname_ssn like '%123456789%' at the end of the query. When I remove the or oth_tchname_ssn like '%123456789%' it returns 32 records which seems about right. Any ideas as to whe
-
IPad in Spain. Do I need to step down the voltage?
For travel in Spain will the ipad wall charger step down voltage? From experience I do not need a step down adapter when using the Apple power cord on an ibook or Mac Book, but am not confident the same applies for the ipad wall charger. I know I nee
-
Service Control Not Being Generated Correctly from WSDL
Hello, I am using BEA Workshop for WebLogic Platform 9.2.0 for development. I created a web service in Workshop, which exposes 3 methods... one of the methods, putPlan(), accepts two parameters. After generating the WSDL from the web service class, I
-
Hello everyone. I am using BPC (7.5 - MS - SP04), where I have a problem in using the sentence * CLEAR_DESTINATION. There are 5 applications in which, from 1 to 4 send data to 5 and the passage between them is performed by Script Logic. The problem i