主题:  如何在flash中跳转至一个页面(url)?

颐和园

职务:普通成员
等级:1
金币:0.0
发贴:17
#12000/12/7 19:38:25
我用一个flash发布成html后做为cover,想当鼠标点击该flash后跳转至另一页面,而不是跳转至(go to)frame?



5D精英

职务:普通成员
等级:3
金币:10.0
发贴:1340
#22000/12/7 20:46:40
Jumping to a different URL

To load a document from a specific URL into a browser window, or to pass variables to another application at a defined URL, you use the Get URL action. (Variables store named values that can be retrieved for use in scripts.) For example, you can send variable data to a CGI script for processing in the same way as you would an HTML form. Only variables for the current movie are sent.

Typically, you would use the Get URL action to load a Web page, but you can also use it in a Flash projector to open a browser window automatically and display the specified URL.

Testing this action requires that the requested file be at the specified location and that absolute URLs have a network connection (for example, www.myserver.com/).

For information on passing variables, see ActionScript Help.

To jump to a URL:

1 Select the frame, button instance, or movie clip instance to which you will assign the action.
2 Choose Window > Actions to display the Actions panel.
3 In the Toolbox list, click the Basic Actions category to display the basic actions, and select the Get URL action.
4 In the Parameters pane, enter the URL from which to get the document, following these guidelines:
Use either a relative path such as mypage.html or an absolute path such as /www.mydomain.com/mypage.html.
A relative path is a shorthand version of the full address that lets you describe one file's location in relation to another; it tells Flash to move up and down the hierarchy of nested files/folders/directories, starting from the file where you issued the Get URL instruction. An absolute path is the complete address that specifies the name of the server on which the file resides, the path (the nested hierarchy of directories, volumes, folders, and so on), and the name of the file itself.
To get a URL based on the value of an expression, select Expression and enter an expression that evaluates to the URL's location.
For example, the following statement indicates that the URL is the value of the variable dynamicURL:
getURL(dynamicURL);

For information on writing expressions, see ActionScript Help.
5 For Window, specify the window or HTML frame into which the document will be loaded, as follows:
Choose from the following reserved target names:
_self specifies the current frame in the current window.
_blank specifies a new window.
_parent specifies the parent of the current frame.
_top specifies the top-level frame in the current window.
Enter the name of a specific window or frame as it is named in the HTML file.
Select Expression and enter the expression that evaluates to the window's location.
6 For Variable, choose a method for sending variables for the loaded movie to the location listed in the URL text box:
Choose Send Using Get to append a small number of variables to the end of the URL. For example, you use this option to send the values of the variables in a Flash movie to a server-side script.
Choose Send Using Post to send variables separate from the URL, as longer strings in a separate header; this allows you to send more variables and lets you post information collected from a form to a CGI script on the server.
Choose Don't Send to not pass any variables.
See ActionScript Help.
Your code would look similar to the following:
getUrl ("page2.html", "blank");

where the Get URL action loads the HTML document "page2" into a new browser window.



颐和园

职务:普通成员
等级:1
金币:0.0
发贴:17
#32000/12/8 22:46:54
我明白了getUrl ("page2.html", "_blank")的形式来go to url,第一个参数page2.html是target url,第二个参数是窗口名或帧名,变量传递可以用get和post两种方式(就像提交表单一样)。
thank you very much!