Tower Defense Action Script Problem
Hi, I've been working my way through a tutorial to create a tower defense game. I've ran into a slight problem with a bit of code:
package{
imporProxy-Connection: keep-alive
Cache-Control: max-age=0
I get an Identifier 1078 error, I was hoping that someone might be able to tell me a little more about what this is doing, and
if anyone knows of a solution. Any help would be greatly appreciated!
Here is the link for the tutorial
http://www.flashgametuts.com/tutorials/as3/how-to-create-a-tower-defense-game-in-as3-part- 2/
Remove the 2 lines. They're not AS.
imporProxy-Connection: keep-alive
Cache-Control: max-age=0
Similar Messages
-
Action script problem for audio player
i have made a introduction with a audio and controller. I am facing one problem. I will like to play as soon as some one enter the page but it does not.
My action script is pasted below and kindly advise me for any changes that can be done
var soundReq:URLRequest = new URLRequest("Sonu Nigam_Alka Yagnik - Suraj Hua M.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var volumeControl:SoundTransform = new SoundTransform();
var resumeTime:Number = 0;
sound.load(soundReq); sound.addEventListener(Event.COMPLETE, onComplete);
up_btn.addEventListener(MouseEvent.CLICK, increaseVolume);
down_btn.addEventListener(MouseEvent.CLICK, decreaseVolume);
function onComplete(event:Event):void
play_btn.addEventListener(MouseEvent.CLICK, playSound);
stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
function playSound(event:MouseEvent):void
{ soundControl = sound.play(resumeTime);
pause_btn.visible = true;
pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
play_btn.visible = false; play_btn.removeEventListener(MouseEvent.CLICK, playSound);
function pauseSound(event:MouseEvent):void {
resumeTime = soundControl.position;
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
function stopSound(event:MouseEvent):void {
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false; pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
function increaseVolume(event:MouseEvent):void {
volumeControl.volume += .5;
soundControl.soundTransform = volumeControl;
function decreaseVolume(event:MouseEvent):void {
volumeControl.volume -= .5;
soundControl.soundTransform = volumeControl;
pause_btn.visible = false;i am having big problem with the coding below with the sound. As it we enter the site, the music auto start very loud which is not good at all for the ear drums. How do i adjust that?
www.hitenkajal.co.uk
var soundReq:URLRequest = new URLRequest("10 Kabhi Alvida Naa Kehna_0.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var volumeControl:SoundTransform = new SoundTransform();
var resumeTime:Number = 0;
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
up_btn.addEventListener(MouseEvent.CLICK, increaseVolume);
down_btn.addEventListener(MouseEvent.CLICK, decreaseVolume);
function onComplete(event:Event):void
play_btn.addEventListener(MouseEvent.CLICK, playSound);
stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
function playSound(event:MouseEvent):void
soundControl = sound.play(resumeTime);
pause_btn.visible = true;
pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
play_btn.visible = false;
play_btn.removeEventListener(MouseEvent.CLICK, playSound);
function pauseSound(event:MouseEvent):void
resumeTime = soundControl.position;
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
function stopSound(event:MouseEvent):void
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
function increaseVolume(event:MouseEvent):void
volumeControl.volume = 1;
soundControl.soundTransform = volumeControl;
function decreaseVolume(event:MouseEvent):void
volumeControl.volume = 0.1;
soundControl.soundTransform = volumeControl;
pause_btn.visible = false;
playSound(null); -
Scroll panel action script problem
Hi, I have the following action script:
and its giving me the following errors:
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _xmouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _xmouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _ymouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _ymouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
Location: Scene 1, Layer 'action', Frame 1, Line 24
Description: 1120: Access of undefined prperty _xmouse,
Source: var xdist = _xmouse - 185;
Location: Scene 1, Layer 'action', Frame 1, Line 8
Description: 1120: Access of undefined prperty _root,
Source: var b = stroke.getBounds(_root);
Location: Scene 1, Layer 'action', Frame 1, Line 11
Description: 1120: Access of undefined prperty _ymouse,
Source: if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse
<b.yMin || _ymouse>b.yMax) {
HERE IS MY ACTION SCRIPT
HERE IS MY FILE
flash5.fla
I used the following tutorial
http://www.gotoandlearn.com/
Scrolling Thumbnail Panel.
Please help as to what I should do to fix it please.I can't be certain, because I don't have Flash CS3 on my
computer, but it reads as though your publish settings are set to
the wrong version of Actionscript. The code you have attached is
Actionscript 2, and those errors sound like something that would be
spit out if you are trying to publish to Actionscript 3. Check your
publish settings, and change to AS2. If you are already on AS2,
reply, and will look into further.
Hope this helps. -
Action Script problem with scrolling images
doing a tutorial and got to the stage of action scripting mouse control for scrolling images.
checked the script in Actions. And said it was ok...No errors found.
Tested the movie and there were 2 compiler errors reported.
Scene 1. layer 'action script', Frame 1, line 1: 1120:Access of undefined property _root. _root.onEnterFrame=funtion(){
Scene 1. layer 'action script', Frame 1, line 2: 1120:Access of undefined property _root. _if(_root._xmouse<50){
Scene 1. layer 'action script', Frame 1, line 1: Warning: 1058: Migration issue: The property _root.onEnterFrame=funtion(){
Can anyone help me understand this.
thanksIt sounds like you are mixing up AS2 code with AS3 compiling. You may need to change you publish settings to AS2.
-
I have an .as file with this code within it
so when the send_pb button is pushed then onSendMessage
causes the message to be sent.....I'd like the enter key on the
keyboard to do the same thing. I tried various ways to do it within
the .as file but nothing seems to work.Hi,
Just try to add the listener Object for the KeyBoard
And in the KeyPress Enter, you just check out the Focus,
if it is in the target movieclip , you just call the same
function what you have in the button on
Release......function.... -
Pathing within Action Script Problems
I have code that uses multiple button functions within different movie clips, here is a sample of the code in the last frame of the last movie clip:
stop();
var xmlholderNewsNetwork:URLLoader=new URLLoader(new URLRequest("NewsNetwork.xml"));
xmlholderNewsNetwork.addEventListener(Event.COMPLETE,onloadNewsNetwork);
function onloadNewsNetwork(e:Event):void {
feed.text="";
var xml:XML=new XML(xmlholderNewsNetwork.data);
for (var i:Number=0; i<xml.story.length(); i++) {
feed.appendText(xml.story[i].storyname+"\n"+xml.story[i].body+"\n\n");
topmenu.home.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerHomeNewsNetwork);
function mouseDownHandlerHomeNewsNetwork(event:MouseEvent){
Content.ContentHome.gotoAndPlay(17);
topmenu.Enlist.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerEnlistNewsNetwork);
function mouseDownHandlerEnlistNewsNetwork(event:MouseEvent){
navigateToURL(new URLRequest("https://spreadsheets.google.com/viewform?key=psvc5aYhLuFoImejmLioWew&hl=en"));
topmenu.Roster.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerRosterNewsNetwork);
function mouseDownHandlerRosterNewsNetwork(event:MouseEvent){
Content.ContentRoster.gotoAndStop(36);
topmenu.Forums.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerForumsNewsNetwork);
function mouseDownHandlerForumsNewsNetwork(event:MouseEvent){
navigateToURL(new URLRequest("http://fifthfleetforums.proboards.com/index.cgi"));
topmenu.Commendations.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerCommenNewsNetwork);
function mouseDownHandlerCommenNewsNetwork(event:MouseEvent){
Content.ContentCommendations.gotoAndStop(36);
topmenu.Forms.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerFormsNewsNetwork);
function mouseDownHandlerFormsNewsNetwork(event:MouseEvent){
Content.ContentForms.gotoAndStop(36);
ect....
This code is in Scene1->Content (the instance name)->ContentNewsNetworkd(the instance name, it is a movie clip)
The path, as I think of it is, Scene1.Content.ContentNewsNetwork. However I am getting errors saying that:
1120: Access of undefined property Content.
and
1120: Access of undefined property topmenu.
The buttons are contanted in Scene1->topmenu (instance name)-> then each button, is its own button.
Can someone help me, and if you are confused please tell me and I will try to explain better.
Thanks
FaedotherI'll whittle it down to one of each...
root - Content - ContentNewsNetwork <code is in this timeline>
root - Content - ContentHome
roott- topmenu - home
The least mind boggling way to command the ContentHome and home timelines/contents would be to use a root reference...
MovieClip(this.root).Content.ContentHome.gotoAndPlay(...
MovieClip(this.root).topmenu.home.alpha = ....
The next approach could be a little more relative to the current location...
MovieClip(this.parent).ContentHome.gotoAndStop(...
MovieClip(this.parent.parent).topmenu.home.visible = ....
And the more mind boggling/time consuming/oo-politically correct way would be to add event dispatchers and listeners so that you in no way utilize root or parent references in your code. I'll spare you that one, but if you are interested, here's a link to learn a little more about it: http://forums.adobe.com/thread/470135?tstart=120 -
Maths Problem in Action Script 2.0
Hi surfers,
We have a problem in Action Script 2.0 to solve the maths equation given below:
write a code in Action Script 2.0 to solve these two equation.
Aim: To know the value of "a" in both different equations.
1. 2a + 5 = 3a + 1
2. 4a + 3 = 11
Thanks in Advance.
Pls give me ASAP, i'm struggle here.Hello, you are at the wrong forum. for AS 2.o questions, hop on there: http://forums.adobe.com/community/flash/flash_actionscript
BTY, people answer when they can, not when you want... -
CS4 Action Script display problems
I've just used Flash CS4 for the first time after using CS3 for some time. When using the Action Script window to write code I had the strangest problem. When writing or pasting code in the AS window the last couple of letters or characters get cut off. I checked my preferences and they were they same as they were in CS3 (just to be sure). Both CS3 & CS4 both have the Monaco font as the default. I solved the problem by changing the fint to Arial. Now the AS displays properly.
Wondered if anyone has seen this happen and if they knew if it was a bug or something?
I'm using CS4 with a newer MacBook Pro and sing AS2 in this project.
Thanks so much!
BCfirst button is called Enter and it is btn1 in the libary, i would like that to navigate to scene 2 frame 1. this was a graphics and i converted it to a button have also tried making it a movie clip it still doesn't work. the second button is Autobiogtaphy and it is btn2, i would like that to be navigated to the frame 10 and the frame is called About. I have CS4 and i realised all the stop actions worked when i saved it in CS3 and opedned it back up so since then i have been using that format. im also using AS3 if that makes any difference.
So i realised i haven't been much help on details hope this helps -
Problem with action script from Schewe and Frasier book.
I am working on a Photoshop CS3 action script to
open raw files, do a couple of modifications
in Camera Raw, exit camera raw and save
the file as a jpeg.
I think this should work, because I am working
on an example out of "Camera raw with Adobe
Photoshop CS3" by Schewe and Frasier which
shows the step recorded.
See page 344 of Schewe and Frasier.
In figure 9-11 you see, after the open
statement, 10 lines of details like
"As camera raw"
"Model:Canon 350d" etc.
I get the file path and name line, but
none of the other details reflecting
actions in Camera Raw.
The problem is that in setting up the action, none
of the steps done in camera raw after I do the
open get recorded.
And it works in my old CS version !
Out of frustration I repeated the action
script creation in my old CS version and
it worked fine.
Any idea where I am screwing up ?Crappy format justification:
I sometimes have a day of family
type pictures that are in raw format
that I want to put up on the internet
quickly. I would like to be able to
apply the "Auto" feature, as in general
it seems to be pretty good for something
quick.
OK, it sorta works in CS, go here
http://www.angelplace.net/photos/sample.jpg
It sets up all of the details and gets the
"As camera raw" but opens the .dng file
rather than the Camera raw window.
The point is, these important settings
seem to be saved, which does not happen
in CS3. -
Problem with action script to button
Hello all.
I'm having a problem with my adobe flash CS3 action script. My button cant link to the other URL. I tried to put an action script but i fail. anyone can help me? here the attachment for my flash document.HELLO,
just check navigateToURL() -
Problems adding url link to buttons in action Script 3
each time I added it link 1 to the button on file i get these error messages-
1046: Type was not found or was not a compile-time constant: link1.
1180: Call to a possibly undefined method link1.
Warning: 3594: exec is not a recognized method of the dynamic class RegExp. var r:Object = p.exec(s);
This is the code I am using: import flash.net.navigateToURL; import flash.net.URLRequest; var link_one:link1; link_one = new link1(); stage.addChild(link_one); link_one.addEventListener(MouseEvent.CLICK, buttonClickHandler); function buttonClickHandler(event:MouseEvent):void { var url:String = "http://www.masterpiececorp.com/ARMREF.htm"; var request:URLRequest = new URLRequest(url); navigateToURL(request); } I have no other problems with link 3 or 4, just link 1 I still cannot get my urls link to movie clips on the flash
Can you upload flash here? if not I have a image capture I can use to have you look at my buttons and action script code. i have been to every forum I know and not any have been helpful at all. This is my last hope.
Very frustrated newbie Gina T
Message was edited by: gtaylor0406The way you had your code originally would be correct...
var link_one:link1;
link_one = new link1();
addChild(link_one);
The 1046 error is indicating it doesn't recognize the link1 class. So the first thing you need to make sure of is that you have assigned the link1 class designation to whatever symbol that is in the library. -
Action script with reference to root causing problems in Captivate
Hi All,
I just inserted an animation into Captivate and it seems to
be working as intended; however, i receive a warning stating that
action script referencing "root" may cause the Captivate project
not to work properly or at all.
Has anyone experienced such a problems coming from action
script reference. It appears to be working fine, so I'd rather not
touch it if I can get away with it.If you run into issues there is a technote on Adobe.com that
will advise you
on how to remove or work around using _root references.
Ideally you would
never refer to _root at all.
Steve
http://twitter.com/Stevehoward999
Adobe Community Expert: eLearning, Mobile and Devices
European eLearning Summit - EeLS
Adobe-sponsored eLearning conference.
http://www.elearningsummit.eu -
Problem with action script calculations
I have a simple action script 3 code that will not calculate the correct answer on my PC. I'm running flash cs5 on Window 7 OS. I can move the file to another machine running flash cs4 and it works, but when I run it on my laptop, I get funky answers. see cold below. I have uninstalled and reinstalled cs5 , run the cleanscript for cs5 and cs4 to make sure everything was removed. I have uninstalled and reinstalled flash player. but nothing seems to work. Any help will be appreciated. It acts like Action Script 3 is corrupt or something else that related to Action Script 3. Everything else seems to work. I also have a preloader running with the same issue. It is should be showing the percentage completed but it go 2 5 50 4 32 or something funky like that. Please help.
the code I'm using.
function calculateTotal(evtObject:MouseEvent):void {
var price:Number;
var totalCost:Number;
var numberOfJerseys:Number;
if (jerseyType.text == "2") {
price = 12;
if (jerseyType.text == "1") {
price = 10;
if (playerNames.text == "Y" || playerNames.text == "y") {
price += 1.50;
numberOfJerseys = int(numberOfPlayers.text) +int(numberOfCoaches.text);
totalCost = numberOfJerseys*price;
total.text = String(totalCost);
calc_btn.addEventListener(MouseEvent.CLICK, calculateTotal);
the preloader percentage is
var percent:int = amtLoaded*100
percent_txt.text = String(percent);HELLO,
just check navigateToURL() -
function loadProgress(my_content:ProgressEvent):void {
var percent:Number = Math.floor( (my_content.bytesLoaded * 100) / my_content.bytesTotal );
percent_Txt.text = percent + "%";
preloader.gotoAndStop(percent);
function loadComplete(e:Event):void {currentFrame;}
loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
is not working
Mean
the Text is to 1 - 100 % increase.
But not working that .
Only others are animating
Please some one help mefunction loadProgress(my_content:ProgressEvent):void {
var percent:Number = Math.floor( (my_content.bytesLoaded * 100) /
my_content.bytesTotal );
percent_Txt.text = percent + "%";
preloader.gotoAndStop(percent); // preloader should have frames
1,...,100.*
function loadComplete(e:Event):void {
currentFrame+1;
// the above will do nothing. what are you trying to do?
This action script is not working in my background. Any settings to change.? -
Setting timeout settings for Action Scripts
We are using OIM 11gR1 along with the AD and Domino connectors. We are also using Action Scripts to perform some post create actions on the AD and Domino resources that get created by OIM. The action scripts are being invoked with the correct set of parameters and they do their job. However for both connectors, the connector server (Java connector server for Domino, .NET connector server for AD) times out when waiting for the script to complete. Our scripts are expected to take a long time (30+ seconds).
Based on our testing, the AD connector times out in 30 seconds, and the Domino connector times out in 20 seconds. You would get the below exception in your Java Connector Server log file:
Dec 4, 2013 2:36:41 PM org.identityconnectors.framework.api.operations.ScriptOnConnectorApiOp runScriptOnConnector
FINE: Exception:
java.lang.RuntimeException: Timeout waiting for action, process was terminated
at org.identityconnectors.domino.WinJni._executeWinCommand(Native Method)
at org.identityconnectors.domino.WinJni.executeWinCommand(WinJni.java:31)
at org.identityconnectors.domino.ScriptOnConnector.executeCmdScript(ScriptOnConnector.java:143)
at org.identityconnectors.domino.ScriptOnConnector.runScriptOnConnector(ScriptOnConnector.java:88)
at org.identityconnectors.domino.DominoConnector.runScriptOnConnector(DominoConnector.java:316)
Is there any way to configure OIM so that it waits longer for the action script to complete. The real problem over here is that if 2 users are being provisioned to AD and/or Domino simultaneously (we use access policies to trigger provisioning rules), then the connector (Java or .NET) does NOT invoke the action script for the second user if the action script for the first user times out. It does however create AD/Domino resources for all applicable users. This in itself is a defect - but I need a workaround.
Looking at some old Sun Identity Manager documentation (which became Oracle Waveset), it seems that the entire OIM concept of action scripts has its origins in Sun Identity Manager/Oracle Waveset. And these products did support the notion of timeouts. Have a look at :
http://docs.oracle.com/cd/E19225-01/821-0092/bzbuc/index.html
Does anyone familiar with Oracle OIM code know if custom timeouts are supported by AD and Domino connectors?
Thanks
Aspi EngineerChange the time for the below under 'Web Intelligence Processing Server'
Idle Document Timeout (seconds):
Idle Connection Timeout (minutes):
If you still have problem then try changing the web.xml under the following war files,
AdminTools
PartnerPlatformService
PerformanceManagement
PlatformServices
Maybe you are looking for
-
Where do I find the file to install Adobe Premiere Elements 10 on Windows 7 64 bits?
Hi there. I ran a little search on the forum for that subject but I couldn't find it. So, if it is a double post or something like that, I'm sorry, and please lead me to where it was already talked about. The thing is: I bought the downloadable bundl
-
HP Mini 210 - No Recovery Disk
Hello All, Hope someone can advise what to do. I had bought two HP Mini 210's. I had not made any recovery disks. The hard disk on one of the netbooks failed and I have had a new one installed. I made a recovery disk onto USB from the other workin
-
SAP Courses (Functional)
I am working as a Business Analyst for Asset Management & Inventory control. Please suggest me the best suited SAP certification (Functional) for my domain.
-
CMX / MSE 7.4 - Time-of-Day rule
With Cisco ISE, we can define time-based rules (example: if 2am, user Nancy can't connect via VPN using a non-corporate laptop). With MSE, can we have a rule: if passenger walking through an airport between 4pm and 7pm, advertise the Happy Hour spec
-
Legacy systems down...
Hi, I am working on an SAP XI implementation project My job here is to integrate many leagacy systems with the SAP. Iwanted to know how can ensure that my legacy system,which are connected to XI through interfaces are running. Also, I would like to g