Exemple #1
0
static Variable as_push(AVM &avm){
	ArrayPtr array = avm.getRegister(1).as<Array>();
	if (!array)
		throw Common::Exception("Array::pop this is not an Array object");
	array->push(avm.getRegister(2));
	return Variable();
}
Exemple #2
0
Variable AVM::registerClass(AVM &avm) {
	Variable name = avm.getRegister(1);
	Variable object = avm.getRegister(2);

	if (!name.isString())
		throw Common::Exception("AVM::registerClass(): name is not a string");
	if (!object.isObject())
		throw Common::Exception("AVM::registerClass(): value is not an object");

	if (_registerClass)
		_registerClass(name.asString(), object.asObject());

	return Variable();
}
Exemple #3
0
Variable AVM::call(AVM &avm) {
	Variable name = avm.getRegister(1);
	if (!name.isString())
		throw Common::Exception("AVM::registerClass(): name is not a string");

	info("TODO: ExternalInterface.call(%s,...)", name.asString().c_str());

	return Variable();
}
Exemple #4
0
Variable AVM::gotoAndPlay(AVM &avm) {
	Variable frame = avm.getRegister(1);

	if (!frame.isNumber() && !frame.isString())
		throw Common::Exception("AVM::gotoAndPlay(): parameter is neither a string nor a number");

	info("TODO: gotoAndPlay(%s)", frame.asString().c_str());

	return Variable();
}
Exemple #5
0
Variable ScriptedFunction::operator()(AVM &avm) {
	_buffer.run(avm);
	return avm.getReturnValue();
}