此问题与ActionScript 3.0和Flash CS6有关
我试图让一个物体在某种程度上震动一段时间.我做了一个"movieclip"并制作了这段代码:
import flash.events.TimerEvent;
var Machine_mc:Array = new Array();
var fl_machineshaking:Timer = new Timer(1000, 10);
fl_machineshaking.addEventListener (TimerEvent.TIMER, fl_shakemachine);
fl_machineshaking.start ();
function fl_shakemachine (event:TimerEvent):void {
for (var i = 0; i < 20; i++) {
Machine.x += Math.random() * 6 - 4;
Machine.y += Math.random() * 6 - 4;
}
}
Run Code Online (Sandbox Code Playgroud)
在测试电影时,我发现了多个与此完全相同的错误:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Historieoppgave_fla::MainTimeline/fl_shakemachine()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
Run Code Online (Sandbox Code Playgroud)
此外,物体不会摇晃,但每次嘀嗒声都会向上稳定向上移动一点.
要点:我想知道如何在对象不在舞台/场景之后停止脚本以及如何让它摇晃,因为我没有看到我的脚本有什么问题,请帮忙,谢谢^ _ ^
upload.php的:
<?php
//This is the directory where images will be saved
$target = "pics";
$target = $target . basename( $_FILES['Filename']['name']);
//This gets all the other information from the form
$Filename=$_POST['Filename'];
$Description=$_POST['Description'];
$pic=($_FILES['Filename']['name']);
// Connects to your Database
mysql_connect("localhost", "root", "") or die(mysql_error()) ;
mysql_select_db("altabotanikk") or die(mysql_error()) ;
//Writes the information to the database
mysql_query("INSERT INTO picture (Filename,Description)
VALUES ('$Filename', '$Description')") ;
//Writes the Filename to the server
if(move_uploaded_file($_FILES['Filename']['tmp_name'], $target)) {
//Tells you if its all ok
echo "The file ". …Run Code Online (Sandbox Code Playgroud)