首页 \ 问答 \ AS3:如何从影片剪辑内部返回主框架(AS3 : how to back from inside of movie clip to main frame)

AS3:如何从影片剪辑内部返回主框架(AS3 : how to back from inside of movie clip to main frame)

我在主框架上的另一个影片剪辑中有一个影片剪辑(符号2)。 当影片剪辑完成播放时,我想回到第2帧的主时间轴(第200帧)。 然后我在我的最后一个影片剪辑框架(框架200)上执行此操作:

MovieClip(root).gotoAndStop(2);

它工作,我去主框架(框架2)但我也得到一个错误:

TypeError:错误#1009:无法访问空对象引用的属性或方法。 at hehe_fla :: Symbol2_2 / frame200()[hehe_fla.Symbol2_2 :: frame200:1]


I have a movie clip (symbol 2) inside another movie clip on the main frame. I want to get back to the main timeline in frame 2 when the movie clip is finish to play (frame 200). Then I do this on my last movie clip frame (frame 200) :

MovieClip(root).gotoAndStop(2);

It works, I go to the main frame (frame 2) but I also get an error:

TypeError: Error #1009: Cannot access a property or method of a null object reference. at hehe_fla::Symbol2_2/frame200()[hehe_fla.Symbol2_2::frame200:1]


原文:https://stackoverflow.com/questions/26774456
更新时间:2022-07-04 22:07

最满意答案

float在Python中实现双点精度。 除非数字具有两个分母的幂,否则它不能用Python精确表示,而只能“大约” - 直到第16位。 因此,数字如:1,0.5,0.25可以准确表示,但像你的情况(3.3)那样的数字只能表示为“近似”。 一切正确,最多16位,然后你得到最后3位,这是不正确的。


float in Python implementing double point precision. Unless a number has power two denominator, it cannot be represented exactly by Python, but only "approximately" - up to the 16-th digit. Thus number like: 1, 0.5, 0.25 can be represented exactly, but number like your case (3.3) can only be represented "approximately". Its all correct, up to the 16 digit, and then you get the last 3 there, which is incorrect.

相关问答

更多
  • Python 3.5添加了math.isclose 485中描述的math.isclose和cmath.isclose函数 。 如果您使用的是较早版本的Python,则文档中将给出等效功能。 def isclose(a, b, rel_tol=1e-09, abs_tol=0.0): return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) rel_tol是一个相对容差,它乘以两个参数的较大值; 随着值越大,它们之间的允许差异也越 ...
  • float在Python中实现双点精度。 除非数字具有两个分母的幂,否则它不能用Python精确表示,而只能“大约” - 直到第16位。 因此,数字如:1,0.5,0.25可以准确表示,但像你的情况(3.3)那样的数字只能表示为“近似”。 一切正确,最多16位,然后你得到最后3位,这是不正确的。 float in Python implementing double point precision. Unless a number has power two denominator, it cannot b ...
  • 反 使用下面关于问题陈述的假设(时间有效地给出如.06的值为60毫秒),如果我们将.06转换为float并将其加1800次,则计算结果为107.99884796142578125。 这与数学结果108.000不同,超过.001。 因此,计算结果有时会与数学结果的差异超过1毫秒,因此在这些条件下无法实现问题所需的目标。 (进一步完善问题陈述和替代计算方法可能能够实现目标。) 原始分析 假设我们在[ float y = x / 1000.f; ]中有1800个整数值,使用float y = x / 1000.f ...
  • 如果将反序列化为强类型对象,其中x和y属性为小数,则不会丢失任何精度。 If you deserialize into a strongly typed object where the x and y properties are decimals then you won't lose any precision.
  • @ Toji:非常感谢! 这里有一个版本,可以对V8等非高端引擎进行优化 function decodeFloat16 (binary) { var exponent = (binary & 0x7C00) >> 10, fraction = binary & 0x03FF; return (binary >> 15 ? -1 : 1) * ( exponent ? ( exponent === 0x1F ? ...
  • C#规范就这个话题说了这么多: 只有在性能成本过高的情况下,才能使这种硬件架构以较低的精度执行浮点运算,而不是要求实现失去性能和精度,C#允许更高精度的类型用于所有浮点运算。 除了提供更精确的结果外,这很少有任何可衡量的影响。 因此,需要第三方库来模拟符合IEEE 754标准的FPU的行为。 其中一个是SoftFloat ,它创建一个SoftFloat类型,它使用运算符重载来模拟标准的double行为。 The C# spec has this to say on the topic: Only at ex ...
  • 从Python文档: 注意对于浮点数, round()的行为可能会令人惊讶:例如, round(2.675, 2)给出2.67而不是预期的2.68 。 这不是一个错误:这是因为大多数小数部分不能完全表示为浮点数。 有关更多信息,请查看每个程序员应该知道的关于浮点运算的内容 。 如果您不了解计算机如何处理浮点数,请不要使用此代码 。 如果你知道自己遇到了什么麻烦: fn approx_equal(a: f64, b: f64, decimal_places: u8) -> bool { let fac ...
  • 从Python文档: 浮点数通常在C中使用double实现; sys.float_info中提供了有关运行程序的机器的浮点数的精度和内部表示的信息。 sys.float_info是一个结构序列,包含有关float类型的信息。 它包含有关精度和内部表示的低级信息。 import sys print(sys.float_info.mant_dig) mant_dig属性指向浮点精度:浮点数有效数中的基数 - 数字 几乎所有平台都将Python浮点数映射到IEEE 754双精度。 From Python do ...
  • Javascript中的所有数字变量都被视为64位浮点数(双精度数)。 一旦从DataView将其读入变量,它就会以该形式出现。 DataView对象上的set*方法允许您使用各种打包形式在ArrayBuffer中设置字节: dv.setUint16(0, 12); dv.getUint16(0); // >>> 12 但你必须小心自己夹紧它: dv.setUint16(0, -12); dv.getUint16(0); // >>> 65524 对于签名的int16: dv.setInt16(0, - ...
  • 首先,没有必要按照您的建议比较两个具有误差容限的浮点数。 两个浮点数之间的关系取决于它们的派生方式,并且在应用程序之间存在巨大差异。 对此没有统一的答案。 其次,当且仅当值相等时,两个舍入值的相等比较才会返回true。 允许任何类型的公差来获得“近似等于”函数将不起作用(如果公差小于舍入距离)。 但是,浮点中的舍入值是有问题的,因为小错误可能会将值从舍入点的一侧移动到另一侧。 例如,考虑将f1舍入到最接近的整数,其中f1是您使用包含舍入误差的浮点运算计算的某个值。 (当操作的数学结果不能完全表示时,会发生舍 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)