Jump to content

Cryzabey

Members
  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Cryzabey

  • Rank
    Newbie
  1. I'm attempting to play songs dynamically in AS3, but I'm having a little bit of trouble. At the very bottom I've included the portion of my script that focuses around the audio.The audio plays if: songPlayer = song1.play(); But not if: var playMe = ["song"+currentSong".play();"]; trace(playMe); songPlayer = [playMe].play(); Basically, I can't get it to play my audio unless I specify the sound. Any attempts at trying to make it dynamic are less than fruitful. Any/all help is appreciated [: //// createMusicPlayer()//// Creates the music player, and sets up the events// that control how the main BG song is played.// public var currentSong:int = 1; public var lastPosition:Number = 0; public var isPlaying:String = "true"; public var stopBTN:SimpleButton = new SimpleButton(); public var playBTN:SimpleButton = new SimpleButton(); public var pauseBTN:SimpleButton = new SimpleButton(); public var skipForwardBTN:SimpleButton = new SimpleButton(); public var SkipBackwardBTN:SimpleButton = new SimpleButton(); public var playlist:Array = new Array("song1", "song2", "song3", "song4"); public function createMusicPlayer() { // Setting up song settings songSettings.volume = 0.5; songPlayer.soundTransform = songSettings; // Creating and placing music controls pauseBTN = new BT_MusicPause; pauseBTN.x = 550; pauseBTN.y = 20; addChild(pauseBTN); stopBTN = new BT_MusicStop; stopBTN.x = (pauseBTN.x + 70); stopBTN.y = 20; addChild(stopBTN); // Adding event listeners stopBTN.addEventListener(MouseEvent.CLICK, onClickStop); pauseBTN.addEventListener(MouseEvent.CLICK, onClickPause); var playMe = ["song"+currentSong".play();"]; trace(playMe); songPlayer = [playMe].play(); }//// onClickStop()// function onClickStop(e:MouseEvent):void{ // Stop isPlaying = "false"; lastPosition = 0; songPlayer.stop(); // Switch out buttons if(pauseBTN.hasEventListener(MouseEvent.CLICK)){ playBTN = new BT_MusicPlay; playBTN.x = pauseBTN.x; playBTN.y = 20; removeChild(pauseBTN); addChild(playBTN); playBTN.addEventListener(MouseEvent.CLICK, onClickPlay); pauseBTN.removeEventListener(MouseEvent.CLICK, onClickPause); } }//// onClickPause()// function onClickPause(e:MouseEvent):void{ // Save position and stop isPlaying = "false"; lastPosition = songPlayer.position; songPlayer.stop(); // Switch out buttons playBTN = new BT_MusicPlay; playBTN.x = pauseBTN.x; playBTN.y = 20; removeChild(pauseBTN); addChild(playBTN); playBTN.addEventListener(MouseEvent.CLICK, onClickPlay); pauseBTN.removeEventListener(MouseEvent.CLICK, onClickPause); }//// onClickPlay()// function onClickPlay(e:MouseEvent):void{ // Stop, then resume/play isPlaying = "true"; songPlayer.stop(); songPlayer = song1.play(lastPosition); songPlayer.soundTransform = songSettings; // Switch out buttons pauseBTN = new BT_MusicPause; pauseBTN.x = playBTN.x; pauseBTN.y = 20; removeChild(playBTN); addChild(pauseBTN); playBTN.removeEventListener(MouseEvent.CLICK, onClickPlay); pauseBTN.addEventListener(MouseEvent.CLICK, onClickPause); }
  2. I'm not quiet sure I follow. I don't understand what you're saying in your second sentence, or get why that would be the case.The login script returns the same html data that is rendered if you're logged in when the page loads. So the HTML content is loaded before the logout function is triggered by the on click function.
  3. Here's a rundown of what happens. I enter my test username and password into the input fields and click "Login". A small loader image takes the place of the login form while the server processes my login request. The loader is then replaced with the results of the login request. If successful, the username of the account and a logout button are presented. If the logout link is clicked, nothing happens. However, if the page is refreshed and the logout button is pressed... The username and logout button are removed and replaced with a small loader image while the server processes the logout request. The loader is then replaced with the login form. What I need help with is making it so the user does not have to refresh the page in order to logout. Any help, at all, is appreciated. <script type="text/javascript" charset="utf-8">$(document).ready(function() {// AJAX Login $("#login-form").submit(function() { // Password and Username Values // #name has to be equal to the ID value of the html field var unameval = $("#username").val(); var pwordval = $("#password").val(); // Spinning Loader $("#login-form").replaceWith('<div id="load" class="load"><center><img src="images/ajax-loader.gif" alt="ajax spinning loader" /></center></div>'); // Post Info to .php, retrieve data $.post("user/loginProcess.php", { username: unameval, password: pwordval }, function(data) { // display result of login request $("#load").html(data); }); return false; });// Ajax Logout $("p logout a").click(function(event){ // Spinning Loader $("#load").replaceWith('<div id="load" class="load"><center><img src="images/ajax-loader.gif" alt="ajax spinning loader" /></center></div>'); // Logout [: $("#load").load("user/logout.php").html; return false; });});</script> <div class="login"> <div id="anchor" style="display:none"><a href="#top">Back to Top</a></div> <?php if(isset($_SESSION['username'])) { echo " <div id='load' class='load'> <p> <a href='#'>My Account</a> | <!-- Using <logout> tags so JQuery can Find this baby --> You're logged in as $username (<logout><a href='#'>Logout</a></logout>) | <a href='#'>Help</a> </p> </div>"; }else{ ?> <form id="login-form" name="login-form" method="post" action="user/loginProcess.php"> <label> <input name="username" type="text" class="text" id="username" value="login..." /> </label> <label> <input name="password" type="password" class="text" id="password" value="password..." /> </label> <label> <input type="image" name="imageField" id="imageField" src="images/top_login.gif" class="button_search" /> </label> </form> <?php } ?> </div>
  4. Nevermind.I removed all of the junk about padding and margin.I then used some position:relative; and top: #px; to achieve what I wanted [:
  5. Test LinkI'm having some trouble. I have an X-axis with tick marks beneath it. I've established margins and paddings to be 0, so I don't quiet understand why a gap still exists between the X-Axis and tick marks. Any help would be appreciated. (Problem is consistent throughout all browsers.)<!--- X-Axis Display Code ---> <div style='width: 886px; margin-top: 2px; padding-top: 2px;'></div> <div style='background: url(bargraph_images/bar.jpg) repeat-x; width: 722px; height: 3px; margin: 0px; padding: 0px;'></div> <!--- Tick Marks ---> <img style='margin: 0px; padding: 0px;' src='bargraph_images/bar2.jpg' /> <img style='margin: 0px; padding: 0px; margin-left: 114px;' src='bargraph_images/bar2.jpg' /> <img style='margin: 0px; padding: 0px; margin-left: 114px;' src='bargraph_images/bar2.jpg' /> <img style='margin: 0px; padding: 0px; margin-left: 114px;' src='bargraph_images/bar2.jpg' /> <img style='margin: 0px; padding: 0px; margin-left: 114px;' src='bargraph_images/bar2.jpg' /> <img style='margin: 0px; padding: 0px; margin-left: 114px;' src='bargraph_images/bar2.jpg' /> <img style='margin: 0px; padding: 0px; margin-left: 114px;' src='bargraph_images/bar2.jpg' /> <!--- Cash Increments ---> <div style='clear:both; padding:0; margin:0; background:none;'></div> <div style='width: 100%; color: #000000; font-size: 14px;'> <div style='display: inline-block; float: left; padding-bottom: 5px; width: 60px;'>$0</div><center> <div style='text-align: center; float:left; width:120px; display: inline-block; padding-bottom: 5px;'>$20,000</div> <div style='text-align: center; float:left; width:120px; display: inline-block; padding-bottom: 5px;'>$40,000</div> <div style='text-align: center; float:left; width:120px; display: inline-block; padding-bottom: 5px;'>$60,000</div> <div style='text-align: center; float:left; width:120px; display: inline-block; padding-bottom: 5px;'>$80,000</div> <div style='text-align: center; float:left; width:120px; display: inline-block; padding-bottom: 5px;'>$100,000</div> <div style='text-align: center; float: left; width:120px; display: inline-block; padding-bottom: 5px;'>$120,000</div></center> </div>
  6. Problem AreaThe values beneath the ticks on the graph currently align decently because the values and size of the text has been figured into the below padding:<div style='display: inline; float: left; padding-bottom: 5px; padding-left: 34px;'>$110,000</div> However, if I ever change the text size or remove the "$" sign, then the spacing becomes wrong. Is there a way to attach the text value to a specific x-pixel so that the center of the text is always at that mark? Or at least something along those lines [:
  7. Example SitePasteBin of OutputSo, I'm on the last step to completing my PHP Function Bar Graph when...I find that the output that's created causes the increment values on the x-axis to disappear in Internet Explorer when enclosed in a table. I'm at a loss as to why this is occurring, and I would appreciate any and all help.
  8. The Example Site1. My X-axis is the perfect size in Chrome and IE, but a pixel too short in FF. This makes my tick jump to the next line.2. Also, in all three of the browsers, my final tick mark value always jumps to the next line. Is there a way to make sure it doesn't line break?Any and all help is appreciated, even if it's advice on something other that what I'm asking for help on. Also, everything is dynamically configured via a PHP function I'm making. Hence the odd style elements in place of style sheets.
  9. Thank you!This works like a charm [;Also, all of this is being created dynamically depending on the parameters the function takes in. That's why I'm using display elements rather than style sheets. Now I just have to fiddle with it to get the spacing between the bars back [;
  10. I'm attempting to get the monetary values that follow the bars on my bar graph to remain aligned with the bars. Currently, no matter how I tweak the coding, the values lay either beneath the bar or only half-way inside of them. Below is an example of what the code looks like, as well as a link: <!--- Bar 1's Display Code ---> <div style=''> <div style='background: url(images/r33.gif); background-repeat: repeat; height: 33px; max-width: 500px;'> <font style='line-height: 33px; margin-left: 15px; color: #000000; font-size: 12px; font-style: normal; font-weight: bold;'> Job One </font> </div> <font style='line-height: 0px; margin-left: 520px;'> $2,000 </font> </div> And a living example can be found here: Link
  11. Cryzabey

    Margin-top Issues

    Thanks Dsonesuk!Worked perfectly [:
  12. Cryzabey

    Margin-top Issues

    Page With The Occuring ProblemI'm having troubles getting the margin-top to work with my text. I am attempting to use this property to center the text into the middle of the graph bars. Here is the coding used in one of the bars:<!--- Bar Background ---> <div style='background: url(images/r33.gif); background-repeat: repeat; height: 33px; max-width: 500px;'><!--- Text On Bar ---><font style='color: #000000; font-size: 12px; text-decoration: none; font-style: normal; margin-top: 10px; margin-left; 15px;'>Job One</font></div> <!-- Spacer used as buffer between Bars --><div style='background: url(images/spacer.gif); background-repeat: repeat; height: 5px; max-width: 500px;'></div> Any and all help would be appreciated [:
  13. Cryzabey

    Flash Banner Help

    Mmk. Got it to work.At first I thought maybe it had something to do with the ActionScript, but it turns out that it's actually something much simpler. Follow this path:Main Timeline -> Banner_MCThen resize the mask layer and button layer to the size of the images you intend to show. Both use button_mc for their surface area.If you need further explanation, or the tweaked file, just let me know.
  14. It looks nice, but there are a couple of small things that are bothering me.1. The site's name is obnoxiously long.2. When you click a link on the nav bar, the area from the left side of the page to the link you clicked is highlighted.3. Underneath "Blog" on every page but the home one there is a black smudge.4. There is an indentation/crease in the background image.5. Her picture on the "Meet the coach" page takes a long time to load.Overall, it's a nice website. The color scheme works well, and I think that it accurately portrays the message that it's going for. Good job [:
  15. Not bad. Better than the majority of the websites that litter the web.By chance, did you provide them with an easy to use CMS?
×
×
  • Create New...