Actionscript help for a noob?

A place for tutorials on how to get the most out of Flash

Re: Actionscript help for a noob?

Postby Terrantor!!! » Wed Dec 03, 2014 6:04 pm

have you tried putting the () after currentLabel so it looks like ( player.currentLabel() != animationState) ? That's usually what that error message means. The reason being it's probably a set function with a return value so it has two purposes. you can set it to play a certain label by typing currentLabel="label" and in order to return the label, you need the parentheses to run the return part of the function.
User avatar
Terrantor!!!
 
Joined: Thu Aug 23, 2012 10:36 am

Re: Actionscript help for a noob?

Postby hat973 » Thu Dec 04, 2014 9:14 am

try it just cycled threw the animation the link below is the guy tutorials i was fallowing for the scripted I am using now i skiped some of the steps I didn't need main 5 threw 8 but those where about levels double jumps and a moving background i was focusing on the player

http://as3gametuts.com/2012/04/26/platformer-9/
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Re: Actionscript help for a noob?

Postby hat973 » Mon Dec 08, 2014 9:31 am

since this script is bugging people i got a qustion if i re did the coding in flash devlope would it be nicer to use or am i better off with trying to figer out action script 3 out
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Re: Actionscript help for a noob?

Postby Terrantor!!! » Wed Dec 10, 2014 9:32 am

The physics portion works like a charm so leave that as is. The animation manager needs debugging, a redo wouldn't hurt, either. It might be your hitCage,too. I'd put trace functions in each hitTest. You don't need to go into a flash developer either. Just make an actionscript class in flash pro and link it to your library object through your Library Panel. Then set a function you can call from anywhere. Looks like this:

public function state(curState:string):void{
this.gotoAndPlay(curState);
}

then when you want a change to trigger you just call that function:

instance_name.state("idleOrWhatever");
User avatar
Terrantor!!!
 
Joined: Thu Aug 23, 2012 10:36 am

Re: Actionscript help for a noob?

Postby hat973 » Mon Mar 14, 2016 8:47 am

I'm posting this here for both help and so my coder can see when he needs but for now I could use any help. the top code is the Main script while the bottom code is tied to Buttons. I have 8 different images on movie clips that would change the look of my actor aka a plate swap and I get a error code all the time from it "ReferenceError: Error #1069: Property label not found on flash.display.SimpleButton and there is no default value.
at Bunny_fla::MainTimeline/clickHandler() "
does anyone know what could be going on? Also I wish to add you I'd like to figure out how to do something in random generation like Boob size for example

Spoiler (click to show/hide):

Code: Select All Code
    var fArmor:String="Bunny A";
   
    function fReArm(BunnyPos:MovieClip):void{
      BunnyPos.Bunny_head.gotoAndStop(fArmor);
      BunnyPos.Bunny_body.gotoAndStop(fArmor);
      BunnyPos.Bunny_front_arm.gotoAndStop(fArmor);
      BunnyPos.Bunny_front_forearm.gotoAndStop(fArmor);
      BunnyPos.Bunny_front_hand.gotoAndStop(fArmor);
      BunnyPos.Bunny_bra.gotoAndStop(fArmor);
      BunnyPos.Bunny_back_arm.gotoAndStop(fArmor);
      BunnyPos.Bunny_back_forearm.gotoAndStop(fArmor);
      BunnyPos.Bunny_back_hand.gotoAndStop(fArmor);
      BunnyPos.Bunny_front_leg.gotoAndStop(fArmor);
      BunnyPos.Bunny_front_calf.gotoAndStop(fArmor);
      BunnyPos.Bunny_front_foot.gotoAndStop(fArmor);
      BunnyPos.Bunny_back_leg.gotoAndStop(fArmor);
      BunnyPos.Bunny_back_calf.gotoAndStop(fArmor);
      BunnyPos.Bunny_back_foot.gotoAndStop(fArmor);
     
      if ((fArmor=="Bunny A") || (fArmor=="Bunny B")){
        BunnyPos.Bunny_front_nipple.gotoAndStop("nobra");
        BunnyPos.Bunny_back_nipple.gotoAndStop("nobra");
      }
      else {
        BunnyPos.Bunny_front_nipple.gotoAndStop("bra");
        BunnyPos.Bunny_back_nipple.gotoAndStop("bra");
      }
       
    }
Code: Select All Code
buttonLeft.addEventListener(MouseEvent.CLICK, clickHandler);
buttonRight.addEventListener(MouseEvent.CLICK, clickHandler);

function clickHandler(event:MouseEvent):void{
   if(event.currentTarget.label == "left")
   {
      fArmor="Bunny A"
   }
   else
   {
      fArmor="Bunny B" //or whatever the armor is. If there are 3 armors(including 0 armor) one could either add
                    //an else if statement or one could use another method to determine clothes.(ask me later
                 // if you wonder what i mean)
   
   }
   
   //the above could also be rewriten to a switch if enough cases present themselves.
   
   fReArm(Bunny);  //Calls for the gear to change and sends with it the character.
}


Spoiler (click to show/hide):

Bunny.fla
(20.4 MiB) Downloaded 3 times
Last edited by hat973 on Mon Mar 14, 2016 9:18 pm, edited 2 times in total.
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Re: Actionscript help for a noob?

Postby OwnerOfSuccuby » Mon Mar 14, 2016 12:43 pm

Is it possible to post fla file with error ?

If not:

(Property label not found on) - may be you try to gotoAndStop to some frame that your part or some thing does not have ?

Try to comment the parts that you change and check if it is possible - where the mistake is.
User avatar
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Actionscript help for a noob?

Postby hat973 » Mon Mar 14, 2016 9:19 pm

OwnerOfSuccuby Wrote:Is it possible to post fla file with error ?

If not:

(Property label not found on) - may be you try to gotoAndStop to some frame that your part or some thing does not have ?

Try to comment the parts that you change and check if it is possible - where the mistake is.



FLA in the 2nd spoiler on my post on the problem
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Re: Actionscript help for a noob?

Postby OwnerOfSuccuby » Tue Mar 15, 2016 6:54 am

//Bunny.Bunny_bra.gotoAndStop(fArmor);
//Bunny.Bunny_back_arm.gotoAndStop(fArmor);
//Bunny.Bunny_back_forearm.gotoAndStop(fArmor);

//Bunny.Bunny_back_hand.gotoAndStop(fArmor);
//Bunny.Bunny_back_leg.gotoAndStop(fArmor);

This parts have errors in it (No such a name of frame you want to go):
(You have to put there the same name as in all other parts ;) and all will work i hope :mrgreen: )
User avatar
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Re: Actionscript help for a noob?

Postby hat973 » Tue Mar 15, 2016 7:16 am

OwnerOfSuccuby Wrote://Bunny.Bunny_bra.gotoAndStop(fArmor);
//Bunny.Bunny_back_arm.gotoAndStop(fArmor);
//Bunny.Bunny_back_forearm.gotoAndStop(fArmor);

//Bunny.Bunny_back_hand.gotoAndStop(fArmor);
//Bunny.Bunny_back_leg.gotoAndStop(fArmor);

This parts have errors in it (No such a name of frame you want to go):
(You have to put there the same name as in all other parts ;) and all will work i hope :mrgreen: )


I was still working on it but I'd figure if it would still work on the other limbs
Red light panda

:ugeek: Tumbler: Tumbler
:geek: I have a Blog: Red Light Blog
;) I stream to Give me a Watch over at: Picarto
:mrgreen: Donate: Patreon
:roll: Discord:Discord
User avatar
hat973
 
Joined: Tue Apr 24, 2012 12:44 am

Re: Actionscript help for a noob?

Postby OwnerOfSuccuby » Tue Mar 15, 2016 11:25 am

Post working version to your PM please check it. I hope it work like it has to work ;)
User avatar
OwnerOfSuccuby
 
Joined: Fri Jun 11, 2010 9:33 pm

Previous

Return to Tutorials



Who is online

Users browsing this forum: No registered users