             }else{
                 screentransitionbutton.layer.cornerRadius = 25
             }
+            
             screentransitionbuttonarray.append(screentransitionbutton)
+            screentransitionbuttonarray[i].addTarget(self, action: "ScreenTransitionButtontapped:", forControlEvents: .TouchUpInside)
+            screentransitionbuttonarray[i].tag = i
             AnimationMenuView.addSubview(screentransitionbuttonarray[i])
         }
 
         
-        //遷移ボタンの作成
-//        testbutton.frame = CGRectMake(145, 217, 90, 90)
-//        testbutton.layer.cornerRadius = 45
-//        testbutton.backgroundColor = UIColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 0.0)
-////        testbutton.layer.position = CGPoint(x: self.view.frame.width/2+65, y: self.view.frame.height/2-100)
-//        testbutton.addTarget(self, action: "TestButtontapped:", forControlEvents: .TouchUpInside)
         
         //viewへの追加と前後関係の調整
         self.AnimationMenuView.addSubview(circleimageview)

        }else{
            UIView.animateWithDuration(0.3, animations: { () -> Void in
                self.circleimageview.alpha = 0.0
                self.testbutton.backgroundColor = UIColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 0.0)
                self.menushow = 0
            })
            

        if(menushow == 0){      //Menuが出ていない時
            UIView.animateWithDuration(0.3, animations: { () -> Void in
                self.AnimationMenuView.backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0)
                
                for(var i = 0; i < 4; i++){
                    self.screentransitionbuttonarray[i].backgroundColor = UIColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0)
                }
                
                self.view.bringSubviewToFront(self.AnimationMenuView)
                self.menushow = 1
            })
