illegal
59 posts
|
Topic: Game Programming /
Preloader problem, loading swf into MovieClip, Flixel
Hi xraven,
Try this
//change this line:
loaded_swf = event.target.loader.content as MovieClip;
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Help for two simple functions, AS 3.0
is your actionscript on your timeline or in external classes
if timeline then
don’t use public function
also make sure your variable types are defined.
another good point is it to test your key pressed listener
function anyKeyHandler (event:KeyboardEvent):void {
trace("anyKey");
}
//addEventListener
stage.setFocus();
stage.addEventListener(KeyboardEvent.KEY_DOWN, anyKeyHandler, false, 0, true);
good luck.
|
|
|
illegal
59 posts
|
Topic: Game Programming /
help with getting code to communicate well.(as3 only)
for the timeline based you could have any event listener for enter frame or timer event that looks for the change in isShotgun.
or take your code and start using it on one frame. so eventually you can move into classes
|
|
|
illegal
59 posts
|
Topic: Game Programming /
[AS3] Sharing Variables?
oh and should you try to keep all your code in either a document class or on one frame. its the bees knees
|
|
|
illegal
59 posts
|
Topic: Game Programming /
[AS3] Sharing Variables?
do you access frame 5 before going to frame 3?
how about create the variable in frame 1
var playerName:Number;
set the variable on three
playerName = 3;
and access it on frame 5
temp_num = playerNum
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Error opening URL
there is #include in actionscript
//as2
#include “actionsource_config.as”
//as3
include “myscript.as”
also saw a note about not using a ; after as2 include line.
maybe something to do with the extra space in the path /%2DTutorial/
or why is it looking for undefined
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Make a password?!
lol. thats why i’ve included the try and catch statement with it. the point was trying to remove the right click context menu. I’ve already found the new ContextMenu functions so that snippet has to be updated.
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Make a password?!
Hi Carr77, below is simple AS3 version that requires
textfield with instance name status_txt
textfield with instance name input_txt
button with instance name submit_btn
stop();
submit_btn.addEventListener(MouseEvent.MOUSE_DOWN, submitHandler, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, enterSubmit);
status_txt.text = "";
try {
fscommand("showmenu", "false");
} catch (error:Error) {
}
function enterSubmit(event:KeyboardEvent) : void{
if (event.keyCode == Keyboard.ENTER){
submitHandler(null);
}
}
function submitHandler(event:MouseEvent) : void {
if (input_txt.text === "password"){
stage.removeEventListener(KeyboardEvent.KEY_UP, enterSubmit);
submit_btn.removeEventListener(MouseEvent.MOUSE_DOWN, submitHandler, false);
//gotoAndStop(5);
}
}
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Preloader Cannot Find Game
Hi alienconcepts.
do you have a link to you game inside of kongregate? I was going to open your link in safari browser. Then using the safari browser’s window tab to launch the activity window. Inside this activity window you should be able to see what and where each item was downloaded.
Hope this helps
|
|
|
illegal
59 posts
|
Topic: Game Programming /
[AS3][CS4] posting data to php on external server
also try installing vizzy tracer from google code its free and always traces over net and set adobe flash player to debugging mode.
|
|
|
illegal
59 posts
|
Topic: Game Programming /
[AS3][CS4] posting data to php on external server
hi, just following up.
1. Create a new text file named crossdomain.xml.
2. Open crossdomain.xml in a text editor.
3. Add the following XML code to the file:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy
SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="www.yoursite.com" />
<allow-access-from domain="yoursite.com" />
</cross-domain-policy>
4. Save the file.
5. Upload the file to the root directory of yoursite.com (so that the file can be accessed at http://www.yoursite.com/crossdomain.xml).
Reference: http://www.moock.org/asdg/technotes/crossDomainPolicyFiles/
|
|
|
illegal
59 posts
|
Topic: Game Programming /
The 'Enter' Key
make a one frame preloader using addedToStage. sorry in advance don’t have a good example.
function loading() {
addedToStage = function () {
if ( _root.getBytesLoaded() == _root.getBytesTotal() and _root.getBytesLoaded()>50) {
delete addedToStage;
loadMain();
}
};
}
loading();
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Need help with if function (AS3) {Solved}
the error is saying it can’t find the textField1. double check the path and instance name to textField1.
don’t give up this error is a common one.
|
|
|
illegal
59 posts
|
Topic: Game Programming /
navigateToURL talking smack
virror’s http:// sounds good — absolute paths ftw
also could try
var s:String = "www.kongregate.com/accounts/" + userName;
navigateToURL(new URLRequest(s, "_self");
removed flash.net
add target param
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Flash, get your hands off my zero's....
needed that timer class which counts down like two days ago. sigh
|
|
|
illegal
59 posts
|
Topic: Game Programming /
[AS3] Some problems in simple space shooter game
Hi Hudacik
First off you could always edit your original question.
Secondly your trying to remove a explosion from the stage when it doesn’t exist
|
|
|
illegal
59 posts
|
Topic: Game Programming /
duplicate function O.O
try
xDifference = player._x – _root._xmouse;
yDifference = player._y – _root._ymouse;
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Downloading an image
Hi truefire
FileReference Class is AS3 in Flash Player 10 —put no good because your in as2
or could call a .php file that opens save as prompt. —unsure if this will work in kongregate
maybe ask the developer of Rotatix
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Enabling the "right clicking"
Could try
//--------------------------------- FSCOMMAND SHOWMENU FALSE AS3 ------------------------------------//
import flash.system.fscommand;
//try and catch
try {
//disable full right click menu
fscommand ("showmenu", "false");
} catch (error:Error) {
trace ("fscommand "+error);
}
//-------------------------------------------------------------------------------------------//
|
|
|
illegal
59 posts
|
Topic: Game Programming /
'Or' Problem
Quote:
or has also been deprecated for a while, so you should switch over to using || instead.
poor or =(
|
|
|
illegal
59 posts
|
Topic: Game Programming /
Random Movie clip pos.
hi UDMT
how about replace this line
if(_x==510){ //whens its equal to one of the 8 movie clips positions
with this
if(_x>=510){ //whens its greater than or equal to one of the 8 movie clips positions
this._x = 500;
|
|
|
illegal
59 posts
|
Topic: Game Programming /
CPU-intensive games.
In Flash CS4. I know that in the file Publish Settings window under the flash tab. Inside this tab you can find Hardware Accleration: DropDown. Where you can set it to Level 2 – GPU.
As Per LiveDocs:
Level 2 – GPU
In GPU mode, Flash Player utilizes the available computing power of the graphics card to perform video playback and compositing of layered graphics. This provides another level of performance benefit depending on the user’s graphics hardware. Use this option when you expect that your audience will have high-end graphics cards.
|
|
|
illegal
59 posts
|
Topic: Game Programming /
[SOLVED] AS3: Parse a code that is stored in a string
as3 version of include external .txt file worked
include.fla
include include.txt"
include.txt
trace("helloworld");
|
|
|
illegal
59 posts
|
Topic: Game Programming /
[SOLVED] AS3: Parse a code that is stored in a string
how about the include statement.
place xml_functions.as relative to your swf and it runs the code inside. tell it to jump and it will ask how far. you could maybe even build whatever you need to replace this file. eg a php form that will save a textFeild.
whats the harm in trying to replacing the .as with .txt anyways :)
#include "xml_functions.as"
|
|
|
illegal
59 posts
|
|