Jump to content


  • Content Count

  • Joined

  • Last visited

Posts posted by Darkness

  1. I have a bitmap loaded from an external source (a website). This bitmap is loaded in a class, and, when I use it in a frame, I can add it to the stage by using addChild(). This works if I just use this.addChild().However, for certain bitmaps, I've wanted to "group" them together so that I can delete that group all at once. I'd assume I'd need some sort of "container" to do this, though I'm not quite sure how to go about this.I've tried creating a blank movieclip, then using movieClip.addChild(bitmap), though this doesn't seem to work. I'm somewhat new to AS3, so ya. : PAnyway, to sum it up, I want to create some sort of container and use addChild() to add bitmaps to that container, so that later on in the code, I may delete all of the bitmaps that are inside of that container.Help would be much appreciated.

  2. I'm relatively new to Java programming, to a certain extent. More specifically, new to programming applets. I used to do Java programming somewhat about three years ago, but not too regularly.Anyway, I had attempted to create an image and display it to the screen outside of the paint() function. It is in a manually created method called "update_text".

    m_letter1= getImage(getCodeBase(), ut_character);m_graphics1.drawImage(m_letter1, 21, 21, this);

    This executes at the end of the update_text method. However, I get a NullExceptionError when it runs, and therefore the image is not displayed. Here (before the above code is executed), apparently m_letter1 and m_graphics1 are null. ut_character is not. After executing the above code, only m_graphics1 is null.Outside of the update_text method, I defined the graphics and image variables (m_letter1 and m_graphics1):

    private Image m_letter1;private Graphics m_graphics1;

    This is the error I get:

    Exception in thread "Thread-5" java.lang.NullPointerExceptionat base.Main.update_text(Main.java:113)at base.Main.run(Main.java:156)at java.lang.Thread.run(Thread.java:619)

    Main.java:113: m_graphics1.drawImage(m_letter1, 21, 21, this);Main.java.156: update_text();Anyway, I was wondering if there was a way to fix this. I can't necessarily use the paint method, I'm pretty sure, since I don't want all of this displayed exactly at run time.Any help would be much appreciated.

  3. Thanks for the help.The spelling error you mentioned is not actually like that in the actual script, by the way. =PSo, anyway... by adding this instead of window.onclick= find_coordinates;, it worked:

    <body onmousedown='find_coordinates(event);'>


  4. Thanks for replying.Anyway, the problem is that the function which finds the coordinates never seems to fire afterward - I have attempted to use an alert() in the coordinate-finding function, the alteration of a span, etc. Never seems to fire when the button is clicked (the form is never submitted by the way - it fires an AJAX function).

  5. This code finds the X and Y coordinates of a click:

    function find_coorddinates(e){FC_CurrentX= 0;FC_CurrentY= 0;if(!e){e= window.event;}if(e.pageX || e.pageY){FC_CurrentX= e.pageX;FC_CurrentY= e.pageY;}else if(e.clientX || e.clientY){FC_CurrentX= e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;FC_CurrentY= e.clientY + document.body.scrollTop + document.documentElement.scrollTop;}window.ReturnX= parseFloat(FC_CurrentX);window.ReturnY= parseFloat(FC_CurrentY);}

    On the page, I have this:

    window.onclick= find_coordinates;

    Normally it works.. however, if one clicks on a submit field, it does not appear to work:

    <input type='submit' value='Submit' class='submit' onclick=\"this.disabled= true; this.value='Loading...'; submit_field();\">

    In other words, it does not change window.ReturnX and window.ReturnY which are the variables that hold the X/Y co-ordinates. However, if I click anywhere else randomly, it works.

  6. I have an AJAX script which appends the following to a span (well, it's similar):

    <select id='select_thing' onchange='functionhere();'><option value='1' selected>1</option><option value='2'>2</option></select>

    Whenever functionhere() is called, it repeats it (appends the above into that span again).If you select two, it will go back to 1, which it's supposed to do (since, when the AJAX is called, it just puts the above code into the innerHTML).However, if I say:


    after changing the value to 2, it always says 2, even though the selected value is 1.So, basically, it seems to be caching the first selected option or something.Any fix?Thanks

  7. Java is very easy to use, but it can lag badly and be more error-prone. If you want a higher quality game, go with Flash, but it's quite complicated (usually). It can be hard to learn, since one of the only good ways to learn it is by taking classes.

  8. There should be some sort of password required in order to access that page. For example:

    <?phpif($_POST['submit']){if($_POST['field']=="passwordhere"){//allow access}}else{echo "<form method='POST'>Enter the password to proceed.<br /><br /><input type='text' name='field'><br /><br /><input type='submit' name='submit' value='Continue'></form>";}?>

    ...or something like that.

  9. Perhaps div layouts aren't good for beginning programmers/designers. I've been programming (mostly C++, Assembly and PHP, but still...) since I was 8~9 (so, it's been about 5 years), and I'm not fully fond of divs yet (for layouts) as they can be more complicated. Well, that's probably because I despise CSS/HTML and the likes, but yeah. >> PHP is funner. I'll shut up now.Anyway, it's kind of hard to give you any help. We can't really make you a new layout from scratch (okay, most of us can't), and you don't seem to know much about CSS and HTML yet. Maybe you should start reading some of the tutorials here, they are very helpful.Just a bit of advice: it's probably best to make your own layouts. You don't learn if you get others to do everything for you. Trust me, I've been through this kind of phase before. Rather, if you're a beginner, look at the source of some websites which have simple layouts, and learn from it. Don't steal it, you'll get in trouble. I mean, like, look at its source to get an idea of how things can be done. Additionally, the tutorials on this site are quite helpful, as I previously stated.

  10. Um, well, first of all, you shouldn't be copying TPMRPG. :) Try not to, anyway. All the new Pokémon RPGs lately have been copying TPM. Dx

  11. I have a floating div, similar to:<div style='float: left; margin: 3px; background-color: yellow; width: 80px; height: 80px;'></div>That displays a yellow block with the dimension 80x80.However, if I try to do something such as (which I want to be displayed under the first block:<div style='float: left; margin: 3px; background-color: yellow; width: 80px; height: 80px;'></div><br /><div style='float: left; margin: 3px; background-color: yellow; width: 80px; height: 80px;'></div>...The second block just moves down a bit, but stays to the right of the first block.Any way to resolve this?Thanks!

  12. I don't have one yet, though I've used absolute positioning before, which is how I know that this occurs.Basically, it would be sort of like this:

    <div><img src='above.png'><img src='thing.png' style='position: absolute; left: 10px; top: 10px;'></div>

    Sort of, anyway. thing.png would be displayed upon above.png. Sort of like a map on a video game.How would I use floats, margins, and padding instead though? o.O

  • Create New...