Jump to content

racheld

Members
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

0 Neutral

About racheld

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    Toronto
  1. Hi,I have built an XML video player based on a tutorial from the republicofcode.com site. Each thumbnail has a title that loads undernieth it, but I also want to have that same title load in a bar above the thumbnails and videos to show the current title of the video being played. For example if I click on the "video 1" thumbnail, "video 1" displays in the blue bar across the top. Here is a link to a test example. myVideoPlayerHere is my code. You'll notice that I've given it a stab, but not sure what do now. If anyone can help I would be really, really grateful. package myVideoPlayer{ import flash.display.*; import flash.text.*; import flash.events.*; import flash.net.URLLoader; import flash.net.URLRequest; import flash.net.navigateToURL; import flash.xml.*; import fl.video.*; import com.google.analytics.AnalyticsTracker; import com.google.analytics.GATracker; public class MyVideoPlayer_Scaredy extends Sprite{ private var thumb_width:Number; private var thumb_height:Number; private var thumbs_x:Number; private var thumbs_y:Number; private var covers_width:Number; private var covers_height:Number; private var covers_x:Number; private var covers_y:Number; private var video_x:Number; private var video_y:Number; private var my_videos:XMLList; private var myXML:XML; private var my_total:Number; private var main_container:Sprite; private var thumbs:Sprite; private var titles:Sprite; private var header:Sprite; private var cover:Sprite; private var my_player:FLVPlayback; private var i:Number; private var header_txt:TextField; private var link_txt:TextField; private var myFormat:TextFormat; private var buyBkFmt:TextFormat; private var tracker:AnalyticsTracker; private var mySelection:String; public function MyVideoPlayer_Scaredy(){ trace("Yay!!"); var myXMLLoader:URLLoader = new URLLoader(); myXMLLoader.load(new URLRequest("videoPlaylist.xml")); myXMLLoader.addEventListener(Event.COMPLETE, processXML); buyLink.addEventListener(MouseEvent.CLICK, clickBuy); buyLink.buttonMode = true; myLogoLink.addEventListener(MouseEvent.CLICK, linkToSrsPg); myLogoLink.buttonMode = true; var tracker:AnalyticsTracker = new GATracker( this, "UA-4609680-1", "AS3", false ); } function processXML(e:Event):void { var myXML:XML = new XML(e.target.data); thumb_width = myXML.@THUMB_WIDTH; thumb_height = myXML.@THUMB_HEIGHT; thumbs_x = myXML.@THUMBS_X; thumbs_y = myXML.@THUMBS_Y; covers_width = myXML.@COVERS_WIDTH; covers_height = myXML.@COVERS_HEIGHT; covers_x = myXML.@COVERS_X; covers_y = myXML.@COVERS_Y; video_x = myXML.@VIDEO_X; video_y = myXML.@VIDEO_Y; my_videos = myXML.VIDEO; my_total = my_videos.length(); trace(myXML.@TITLE); makeContainers(); callThumbs(); makePlayer(); callTitle(); } function linkToSrsPg(e:MouseEvent):void{ navigateToURL(new URLRequest("http://www.kidscanpress.com/US/CitizenKid-C2539.aspx?section=5&series=2")); var mySelection:String = new String; mySelection = e.target.name; tracker.trackPageview ("seriesLink = " + mySelection); } function clickBuy(e:MouseEvent){ navigateToURL(new URLRequest("http://www.kidscanpress.com/US/How-to-Build-Your-Own-Country-P3151.aspx")); var mySelection:String = new String; mySelection = e.target.name; tracker.trackPageview ("seriesLink = " + mySelection); } function makeContainers():void{ main_container = new Sprite(); addChild(main_container); thumbs = new Sprite(); thumbs.addEventListener(MouseEvent.CLICK, playVideo); thumbs.addEventListener(MouseEvent.MOUSE_OVER, onOver); thumbs.addEventListener(MouseEvent.MOUSE_OUT, onOut); thumbs.x = thumbs_x; thumbs.y = thumbs_y; thumbs.buttonMode = true; main_container.addChild(thumbs); titles = new Sprite(); titles.x = thumbs_x; titles.y = thumbs_y; main_container.addChild(titles); header = new Sprite(); header.x = 0; header.y = 0; main_container.addChild(header); cover = new Sprite(); cover.x = covers_x; cover.y = covers_y; main_container.addChild(cover); trace("my Child"); } function callThumbs():void{ for (var i:Number = 0; i < my_total; i++){ var thumb_url = my_videos[i].@THUMB; var thumb_loader = new Loader(); thumb_loader.name = i; thumb_loader.load(new URLRequest(thumb_url)); thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded); thumb_loader.y = 100+10;//distribution of thumbs thumb_loader.y = (thumb_height+25)*i;//space between thumbs var cover_url = my_videos[1].@COVER; var cover_loader = new Loader(); cover_loader.load(new URLRequest(cover_url)); cover_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, coverLoaded); cover_loader.y = covers_height; var thumb_title = my_videos[0].@TITLE;//adding thumb titles var title_txt:TextField = new TextField(); title_txt.text = thumb_title; title_txt.background = true; title_txt.backgroundColor = 0xffffff; title_txt.height = 40; title_txt.y = thumb_loader.y + title_txt.height + 45; //title_txt.x = thumb_width + 10; //MOVES TEXT FIELD ALONG X AXIS title_txt.width = thumb_width; title_txt.wordWrap = true; titles.addChild(title_txt); } } function callTitle():void{ var myFormat:TextFormat = new TextFormat(); myFormat.size = 18; myFormat.font = "Helvetica"; myFormat.bold = true; var main_title = my_videos[i].@TITLE;//adding titles var header_txt:TextField = new TextField(); header_txt.text = main_title; header_txt.y = 15; header_txt.x = 20; header_txt.textColor = 0xFFFFFF; header_txt.width = 800; header_txt.height = 30; header_txt.setTextFormat(myFormat); addChild(header_txt); } function thumbLoaded(e:Event):void{ var my_thumb:Loader = Loader(e.target.loader); thumbs.addChild(my_thumb); } function coverLoaded(e:Event):void{ var my_cover:Loader = Loader(e.target.loader); cover.addChild(my_cover); } function makePlayer():void{ my_player = new FLVPlayback(); my_player.skin = "SkinUnderPlaySeekStop.swf"; my_player.skinBackgroundColor = 0xAEBEFB; my_player.skinBackgroundAlpha = 0.5; my_player.x = video_x - 140; my_player.y = video_y; my_player.width = 460; my_player.height = 340; my_player.source = my_videos[0].@URL; my_player.autoPlay = true; main_container.addChild(my_player); } function playVideo(event:MouseEvent):void{ var video_url = my_videos[event.target.name].@URL; my_player.source = video_url; my_player.seek(0); } function onOver (e:MouseEvent):void{ var my_thumb:Loader = Loader(e.target); my_thumb.alpha = 0.7; } function onOut (e:MouseEvent):void{ var my_thumb:Loader = Loader (e.target); my_thumb.alpha = 1; } }}
  2. racheld

    Google Analytics

    I’d like to use GA to track a URLRequest in an onClick event, but I keep getting the following error in my code.TypeError: Error #1009: Cannot access a property or method of a null object reference.at myVideoPlayer::MyVideoPlayer_CDN/linkToSrsPg() myLogoLink.addEventListener(MouseEvent.CLICK, linkToSrsPg);myLogoLink.buttonMode = true;function linkToSrsPg(e:MouseEvent):void{var mySelection:String = e.target.name;tracker.trackPageview (mySelection);navigateToURL(new URLRequest(“http://www.kidscanpress.com/Canada/CitizenKid-C5065.aspx?section=5&series=2″));} Any help would be oh, so appreciated!
  3. racheld

    Video Gallery

    Hi,I need to design a video gallery for a web page. The required functionality is to have the main video on the left and thumbnails stacked vertically on the right with headings, so that when you click on a thumbnail it loads the video. I've attached an image of what the design looks like so you can see what I mean. Here's the thing, I would like to avoid using Flash. Can anyone make any recommendations for a solution? Please bear in mind that I'm new developer so I'd ideally like something that is customizable, but no too complicated. I've bean searching for a solution for quite some time without any luck. \Anyway, any help would be greatly, greatly appreciated!
  4. racheld

    CSS Rollovers

    Yaa!!! That worked. Thanks so much for the info! I won't soon forget it.
  5. racheld

    CSS Rollovers

    I have run into one of those situations where I've done something wrong but for the life of me I can't see what it is.I am doing CSS rollovers, and for some reason, the image/link won't appear. Here is a link to the page http://www.kta.on.ca/KTA_site_RVSD/aboPraGro.html. The image link called "PraGroSect_Txt_AP.jpg" just isn't showing up in the green framed box on the top right hand corner of the page. I've also copied and pasted my code below: <div id="programs_navInd"> <ul id="praGro_ul"> <li id="praGro_aboPra"><a href="aboPraGro.html"></a></li> </ul> </div> #programs_navInd{ background-image:url(images/PraGroBackground.gif); height:100px; width:274px; border-style:solid; border-width:1px; border-color:#4a4a4d; float:right; margin:10px; }#praGro_ul{ width:222px; list-style:none; margin-top:10px; margin-left:10px; padding-top:10px; padding-left:10px; float:left; line-height:8px;}#praGro_aboPra a{ background:url(images/PraGroSect_Txt_AP.jpg); width:157px; height:11px; background-repeat:no-repeat; margin-bottom:10px;}#praGro_aboPra a:hover{ background-position: 0 -11px;}
  6. Here are screenshots of how it's displaying in each of the browsers, and then a screenshot of what it's supposed to look like:http://www.kta.on.ca/images/safari.pnghttp://www.kta.on.ca/images/firefox.pnghttp://www.kta.on.ca/images/intendedDesign.png (disregard the colour differences in the text, it's the positions I'm concerned with)Thank You!
  7. I am building the main nav areas of a site I'm working on and can't seem to get firefox and safari to display the elements the same. The positions are different in each browser. Below is my html and css code.Any help would be greatly appreciated!HTML CODE <div id="body"> <div id="container"> <div id="header"> <div id="navArea1"> <ul class="links_ul"> <li id="home"><a href="#"></a></li> <li id="contact"><a href="#"></a></li> <li id="siteMap"><a href="#"></a></li> </ul> </div> </div> <div id="mainBanner"> <div id="navArea2"> <ul class="links_ul"> <li id="hdr_About"><a href="#"></a></li> <img class="separators" src="images/separator.jpg" /> <li id="hdr_Cases"><a href="#"></a></li> <img class="separators" src="images/separator.jpg" /> <li id="hdr_Reports"><a href="#"></a></li> </ul> </div> </div><!--end header--> <div id="areasOfPrac"> <div id="navArea3"> <ul class="links_ul"> <li id="hdr_AboPract"><a href="#"></a></li> <li id="hdr_HealthPract"><a href="#"></a></li> <li id="hdr_manageConsult"><a href="#"></a></li> <li id="hdr_collGov"><a href="#"></a></li> <li id="hdr_govStratPlan"><a href="#"></a></li> <li id="hdr_facil"><a href="#"></a></li> </ul> </div> </div> </div><!--end container div--></div><!--end body div--> CSS CODE @charset "UTF-8";/* CSS Document */#body { margin: 0; padding: 0; text-align: center; font-size: 11px; font-family: Arial, Helvetica, sans-serif; }#container{ width: 715px; text-align: left; /* this overrides the text-align: center on the body element. */ margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto;}#header{ background-image:url(images/topHeader.jpg); width:715px; height:20px; margin-top:0px; margin-bottom:0px;}#navArea1{ float:right; width:175px; margin-top:0px; margin-bottom:0px; }.links_ul{ list-style:none; display:inline;}#home a { background:url(images/basicNav_home.jpg); width: 31px; height:17px; float:left; padding-right:10px; background-repeat:no-repeat;}#home a:hover { background-position: 0 -17px;}#contact a { background:url(images/basicNav_contact.jpg); width: 60px; height:17px; float:left; padding-right:10px; background-repeat:no-repeat;}#contact a:hover { background-position: 0 -17px;}#siteMap a { background:url(images/basicNav_siteMap.jpg); width: 50px; height:17px; float:left; background-repeat:no-repeat;}#siteMap a:hover { background-position: 0 -17px;}#mainBanner{ background-image:url(images/header_blueBkgd.jpg); height:96px; width:715px; margin-top:0; margin-bottom:0px; clear:both; float:none; }#navArea2{ float:right; width:330px; margin-right:16px; margin-top:57px;}.separators{ float:left; padding-right:5px; padding-left:5px; margin-top:-6px;}#hdr_About a { background:url(images/about.jpg); width: 60px; height:18px; float:left; padding-right:2px; background-repeat:no-repeat;}#hdr_About a:hover { background-position: 0 -18px;}#hdr_Cases a { background:url(images/casesClients.jpg); width: 96px; height:18px; float:left; background-repeat:no-repeat;}#hdr_Cases a:hover { background-position: 0 -18px;}#hdr_Reports a { background:url(images/publications.jpg); width: 142px; height:18px; float:left; background-repeat:no-repeat;}#hdr_Reports a:hover { background-position: 0 -18px;}#areasOfPrac{ background-image:url(images/header_AOP_Bkgd.jpg); height:60px; width:715px; }#navArea3{ float:left; margin-left:16px; width:700px; height:38px; padding-top:5px; float:left;}#hdr_AboPract a { background:url(images/aboPract.jpg); width: 59px; height:38px; float:left; padding-right:57px; background-repeat:no-repeat;}#hdr_AboPract a:hover { background-position: 0 -38px;}#hdr_HealthPract a { background:url(images/healthPract.jpg); width: 47px; height:38px; float:left; padding-right:57px; background-repeat:no-repeat;}#hdr_HealthPract a:hover { background-position: 0 -38px;}#hdr_manageConsult a { background:url(images/manageConsult.jpg); width: 69px; height:24px; float:left; padding-right:57px; background-repeat:no-repeat;}#hdr_manageConsult a:hover { background-position: 0 -24px;}#hdr_collGov a { background:url(images/cenCollGov.jpg); width: 81px; height:38px; float:left; padding-right:57px; background-repeat:no-repeat;}#hdr_collGov a:hover { background-position: 0 -38px;}#hdr_govStratPlan a { background:url(images/govStratPlan.jpg); width: 76px; height:38px; float:left; padding-right:57px; background-repeat:no-repeat;}#hdr_govStratPlan a:hover { background-position: 0 -38px;}#hdr_facil a { background:url(images/facilitation.jpg); width: 65px; height:11px; float:left; background-repeat:no-repeat;}#hdr_facil a:hover { background-position: 0 -11px;}
  8. Okay, thanks for your help and your quick response. Now I know.In terms of testing, just to put your mind at ease, I always test using different browsers and such. I just like to do a quick preview from time to time. I also tried viewing the page through my local host thinking that might work, but it didn't. I guess my local host doesn't support server-side includes.Cheers.
  9. Hi,I'm fairly new to web design and am editing a site that was created by a previous developer. The site uses .shtml files to insert the header and footer into all of the web pages. From what I've read this is a good thing and reduces the amount of editing time. The only issue I have is that when I want to preview the main page (index.shtml) through Dreamweaver, it won't show me the header or footer. Is there a way to get around this?Any help would be greatly appreciated.Thanks in Advance!Rachel
  10. I got the PHP to work so thanks for that! Now I am having trouble getting the php to display on the html page. I've used <form action="csvWithphp.php"></form>. Should I be using a get method here?THANKS!
  11. Okay, thanks for your advice, I will try the php route. As for the form tag, that was a previous test that I forgot to delete before I uploaded my post...bad form on my part!
  12. Please help!I am very, very new at the whole web development thing and need a bit of help with figuring out the simplest way to convert a basic csv file into an html table with a verticle scroll bar. Like with all things there is a catch, and that is my client will need to change the linked csv document on a regular basis so this process needs to be made as simple as possible.I found what seemed like fairly clean javascript code that claims to do what I want, but I can't seem to make it work. I tried to insert the " HTML Header data" and " HTML footer data" directly into the html code but that doesn't seem to work either.Below is both my js and html code. Any help solving this problem would be immensely appreciated!!! //javascript// The names of our input and output filesvar src = "toronto_Nov09.csv";var dest = "results.html";// Create some variablesvar fso, fin, fout;var data = new Array();// Define constants for file accessvar forReading = 1;var forWriting = 2;var forAppending = 8; // not used - given for reference// Create File System Object and open input and output filesfso = new ActiveXObject( "Scripting.FileSystemObject" );fin = fso.OpenTextFile( src, forReading );fout = fso.OpenTextFile( dest, forWriting, true );// create file if not found// Write out header and start of tablefout.WriteLine( htmlHeader() );fout.WriteLine( "<table border='0' cellpadding='1' cellspacing='0' width='100%'>" );// Loop through entire filewhile( !fin.AtEndOfStream ){ try { // Read the next line var line = fin.ReadLine(); // If line if blank - skip it if( line == "" ) continue; // Fill our array 'data' which csv data split at ',' // If you are using a different seperator, such as a TAB // you will need to modify the next item // Some examples // data = line.split( "\t" ); // for tab // data = line.split( ":" ); // for colon // data = line.split( " " ); // for space data = line.split( "," ); // Start our table ROW fout.WriteLine( "<tr>" ); // Loop through data elements found on current line for( i = 0; i < data.length; i++ ) { // write TD tags to wrap data fout.WriteLine( "<td>" + data[i] + "</td>" ); } // Close the ROW fout.WriteLine( "</tr>\r\n" ); } catch( e ) { WScript.Echo( "Error: " + e.description ); }}// Close TABLEfout.WriteLine( "</table>" );// Close HTML pagefout.WriteLine( htmlFooter() );// Close input and output filesfin.Close();fout.Close(); /******************************* HTML Header data********************************/function htmlHeader(){ var title = "CSV2HTML"; var head = "<html>\r\n<head>\r\n"; // Title head += "<title>" + title + "</title>\r\n"; // Style Sheet head += "<style>\r\n"; head += " TD { \r\n"; head += " font-family: verdana;\r\n"; head += " font-size: 10pt; \r\n"; head += " border-bottom: thin groove lightyellow;\r\n"; head += " border-top: thin groove lightyellow;\r\n"; head += " color: blue; background: lightgrey;\r\n"; head += " }\r\n"; head += "</style>\r\n"; head += "</head>\r\n<body>\r\n"; return( head );}/******************************** HTML Footer data*********************************/function htmlFooter(){ var foot = "\r\n</body>\r\n</html>"; return( foot );} <!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>Untitled Document</title><script type="text/javascript" src="csv2html.js"></script></head><body><!--<form id="commentForm" action="csvWithphp.php" method="post" onSubmit="return false;"></form>--><p>My csv conversion test</p></body></html>
×
×
  • Create New...