有人可以帮助我与动态网页标题中的ActionScript 3好吗?我与、可以帮助、动态网页、标题

2023-09-08 15:35:52 作者:青春纯属扯淡

HELP!我将如何解决这个问题的ActionScript 3.0,以便它创建一个动态的页面标题为每个网页? 我是新来的ActionScript 3.0和我想要生成使用动态文本的每一页页标题。我在我的网站四页,这里是ActionScript是我到目前为止有:

HELP! How would I fix this Actionscript 3.0 so that it creates a Dynamic Page title for each page? I am new to Actionscript 3.0 and I am trying to generate a page title using Dynamic Text for each page. I have four pages in my site, and here is the actionscript that I have so far:

stop ()
function createTitle (whichpage:String) {
pageTitle.text = whichpage;
};
var page:String="theres no place like home";
createTitle (page);

function btn1Press (MouseEvent) {
gotoAndStop (1);
}

function btn2Press (MouseEvent) {
gotoAndStop (10);
}

function btn3Press (MouseEvent) {
gotoAndStop (20);
}

function btn4Press (MouseEvent) {
gotoAndStop (30);
}

btn1Press.addEventListener (MouseEvent.CLICK, Home);
btn2Press.addEventListener (MouseEvent.CLICK, Services);
btn3Press.addEventListener (MouseEvent.CLICK, About);
btn4Press.addEventListener (MouseEvent.CLICK, Contact);

stop();


1,10,20,30 represent the frames that each page is on

这四个导航按钮设置如下:

The four navigation buttons are setup as follows:

btn1Press = Home Page (Instance name "Home")
btn2Press = Services Page (Instance name "Services")
btn3Press= About Page (Instance name "About")
btn4Press=Contact Page (Instance name "Contact")

我已经有动态文本框设置。基本上,我需要每个按钮去他们各自的网页,我需要在动态文本框中的文本取决于是在哪一页改变。下面是更多的动作,我有在框架10,20和30(服务,约和联系人)

I already have the dynamic text box set up. Basically I need each of the buttons to go to their respective pages, and I need the text in the dynamic text box to change depending on which page it is. Here is the additional actionscript that I have at frames 10,20 and 30 (services,about,and contact)

页=服务;    createTitle(页);    停止();

page = "services"; createTitle (page); stop ();

页=约;    createTitle(页);    停止();

page = "about"; createTitle (page); stop ();

页=接触;    createTitle(页);    停止();

page = "contact"; createTitle (page); stop ();

我变得非常沮丧与这一点,任何帮助会如此真棒!

I am getting really frustrated with this, and any help would be SO awesome!

我不断收到错误#1061有关未定义功能

I keep getting error #1061 about undefined functions

所以,我认为更好的方式来问我的问题是:

So I think a better way to ask my question would be:

我有一个四页的网站在Flash CS4中,第1页开始的第1帧,第2页开始第10帧,第3页开始的第20帧和第4页开始的第30帧有迹象表明,我已经转换四个导航按钮以按钮的符号。我应该怎么叫每个按钮,我应该调用每个按钮的实例?什么code,我需要把在动作面板以获得导航按钮正常工作,并进行动态文本框中显示特定的页面的标题,这是对(欢迎首页 欢迎来到关于页等)

I have a four page site in Flash CS4, Page 1 starts on Frame 1, Page 2 starts on Frame 10, Page 3 starts on Frame 20 and Page 4 starts on Frame 30. There are Four navigation buttons that I have converted to button symbols. What should I call each button, and what should I call the instance of each button? What code do I need to put in the actions panel in order to get the navigation buttons to function properly, and make the dynamic text box display a title specific to the page that it is on ("Welcome to the Home Page", "Welcome to the About Page", etc)

感谢您的帮助+耐心,我发现这一切pretty的混乱。 :(

Thanks for your help + patience, I am finding this all pretty confusing. :(

推荐答案

听起来像是你想从Flex内时,Flex中切换视图动态地更改页面上的HTML标题。要做到这一点的唯一方法是通过javascript从Flex内调用。它会去是这样的:

Sounds like you want to dynamically change the HTML title on a page from within Flex when switching views in Flex. The only way to do this is via javascript called from within Flex. It would go something like this:

FLEX

public function setTitle(title:String):void {
if (ExternalInterface.available) {
	ExternalInterface.call("setTitle", title);
}
}

JAVASCRIPT

JAVASCRIPT

    function setTitle(t){
document.title.innerText = t;
}
 
精彩推荐
图片推荐