PDA

View Full Version : Flash menu working...but needs a kick start


Inspironx
07-16-2008, 05:05 PM
www.creativeglobalmedia.com

Hi,

Strange problem here. When landing on any of the 5 pages in this website the flash menu doesn't not click through to the relevant linked pages. They all appear dead. BUT. When I manually change the URL in a browser to another page, the page loads and the flash works! I can even go back to the landing page and move around.

I am crap at flash and have been trying to figure this for days.

So for some reason the action script is only triggered when moving away from the original entry page.

Pages:

index.html
about.hml
web.html
print.html
contact.php

Script pasted into .html:

<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '713',
'height', '312',
'src', 'flash/CGMflash1a',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'CGMflash1',
'bgcolor', '#000',
'name', 'CGMflash1',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'flash/CGMflash1a',
'salign', ''
); //end AC code
}
</script>
<noscript>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="713" height="312" id="CGMflash1a" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="flash/CGMflash1a.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000" /> <embed src="flash/CGMflash1a.swf" quality="high" bgcolor="#000" width="713" height="312" name="CGMflash1a" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>

Actionscript:

HOME11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/index.html"), "_self");
}
);

WEB11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/web.html"), "_self");
}
);

PRINT11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/print.html"), "_self");
}
);

ABOUT11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/about.html"), "_self");
}
);

CONTACT11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/contact.php"), "_self");
}
);

Hope someone can help me :)

Many thanks,
Fred

Nightfire
07-16-2008, 05:50 PM
There must be something different in the index page one, as that one never works for me

ramm19
07-16-2008, 06:09 PM
Inspironx,

The problem is inside "CGMflash1a.swf", could you post the AS for that file and the AS code for the web .swf file?

I do have a few recommendations...

1) Use "MouseEvent.CLICK" Instead of "MouseEvent.MOUSE_UP".

2)Use relative URLs -> URLRequest("../print.html") or URLRequest("print.html") instead of URLRequest("http://www.creativeglobalmedia.com/print.html")

3)You may want to to swfobject to embed the flash movie.

4) In this case you didn't need to have different movies for each page, you could have use the same movie using vars to dynamically load the different text sections.

5) Why are you using <noscript> ?

Inspironx
07-17-2008, 08:19 AM
Hi,

I have replaced .MOUSE_DOWN with .CLICK

I have used relative urls.

Noted that for future that only one movie is necessary and text can be loaded for each version.

"Why are you using <noscript>?" - This is what Flash CS2 gave me for html output. I simply copied it into my own .html

The AS I pasted in my original post is all I have?!

I am getting some compiler errors:

http://content.screencast.com/media/cb94d874-2473-4daf-b7da-e2334041e6e6_78194884-ca5e-450b-98ac-c3170ef04b9e_static_0_0_00000105.png

Sorry for the late reply. I did set this thread to email me but it never did.

Many thanks :)

ramm19
07-17-2008, 05:15 PM
Inspironx,

Do you have this line on top of your AS? "import flash.events.MouseEvent;" or "import flash.events.*;"

Inspironx
07-17-2008, 05:27 PM
Hmmm sorry the only AS I have seen is the dump in my first post which is associated with the menu.

I have a file called AC_RunActiveContent.js but I don't think you mean that?

Should I be looking elsewhere?

Many thanks.

Inspironx
07-17-2008, 05:33 PM
There must be something different in the index page one, as that one never works for me

That's the thing. You could have landed on any page and it wouldn't have worked. Hitting another page by typing URL makes the flash work on all pages!

So you could arrive on the about.html page and flash won't work.

Type index.html in browser and it will all start working.
It's like the second time round of loading flash triggers it to function.

:confused:

ramm19
07-17-2008, 05:33 PM
inspironx, try this:


import flash.events.MouseEvent; /*<---IMPORT MouseEvent Class*/

HOME11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/index.html"), "_self");
}
);

WEB11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/web.html"), "_self");
}
);

PRINT11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/print.html"), "_self");
}
);

ABOUT11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/about.html"), "_self");
}
);

CONTACT11111.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
navigateToURL(new URLRequest("http://www.creativeglobalmedia.com/contact.php"), "_self");
}
);

Inspironx
07-17-2008, 06:18 PM
Added that line but no change :(

ramm19
07-17-2008, 06:24 PM
do you want to attach it or email it? so I can take a look at it?

Other thing you can do is compare it with the rest of the swfs, the ones that work.

Inspironx
07-17-2008, 06:32 PM
Thank you. I will attach it in a few minutes.

That's the thing. It doesn't matter what page you land on. The flash will not work. If you then navigate to another page it works. You can go back to the page you landed on and the flash will work. Clear the browser cache and it won't work again. Again navigate to another page and it'll start running fine.

All flash are just a copy of the one on index. Just different text changes.

Appreciate this.

I have put up a reward for $40 on another forum and will of course extend that to you :)

Copy and paste:

"If someone can offer the fix or take the relevant files from me and make it work then I will Paypal $40.

I will require the fix or fixed files in my procession before immediately forwarding funds.

Please post here.

Many thanks,
Freddy"

Inspironx
07-17-2008, 06:38 PM
http://rapidshare.com/files/130415026/CGMflash1a.fla.zip.html

Thank you :)

ramm19
07-17-2008, 06:44 PM
inspironx, I'll take a look at it from home since I don't have cs3 installed at the office.

Inspironx
07-17-2008, 06:45 PM
Thank you Sir!

ramm19
07-18-2008, 02:03 AM
Inspironx, I just re-coded your movie so it's easier for you to understand it... I'll update you by PM.

Inspironx
07-18-2008, 06:59 PM
Thank you ramm19 for this! Very happy :)

ramm19
07-18-2008, 07:03 PM
I'm glad I was able to help you! :)