简体   繁体   English

从动作脚本调用mxml

[英]call mxml from actionscript

I am very new to Flex & Action script and here is my requirement: 我对Flex&Action脚本非常陌生,这是我的要求:

There is one boolean flag in action script and if flag value is true then redirect to success.mxml page and if flag value false then redirect to error.mxml page. 操作脚本中只有一个布尔标志,如果标志值为true,则重定向到success.mxml页面,如果标志值为false,则重定向到error.mxml页面。

Can anyone suggest me, how to redirect to mxml page/componenet from action script based on some condition. 任何人都可以建议我,如何基于某种条件从动作脚本重定向到mxml页面/ comonenet。

MXML files are Actionscript class files. MXML文件是Actionscript类文件。 They are not pages as in JSP. 它们不是JSP中的页面。

Although you can add both success.mxml and error.mxml as a child in Application tag and depending upon your flag value, you can set visibility of either to true or false . 尽管您可以在Application标签中将success.mxml和error.mxml都添加为子元素,并根据您的标志值添加,但可以将可见性设置为truefalse

Please Learn some Flex tutorial or book first because this question is too basic to answer. 请先学习一些Flex教程或本书,因为这个问题太基本了,无法回答。

You have to create the two variable with data type of both the mxml. 您必须使用两个mxml的数据类型创建两个变量。

so as you your flag is true, just create a new instance of that variable and you can also call its all the public variable/functions for you as file. 因此,当您的标记为true时,只需创建该变量的新实例,您还可以将其所有公共变量/函数称为文件。 You also call their layout objects if you given them id's. 如果您给了他们id,也可以称呼他们的布局对象。

It is not bound in the Flex. 它没有绑定在Flex中。 You can call anything form anywhere if not then try Events. 您可以在任何地方调用任何形式的内容,然后尝试“事件”。

Try to learn the flex tutorial for that. 尝试为此学习flex教程。 You can also try the Tour de flex. 您也可以尝试Tour de flex。

Regards, Manish 问候,Manish

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM