Place button rollover image on top of external swf
I have a menu that when you click on a button, an external swf is called up. However I would like for the buttons in the Over and Down state to show an image on top of the external swf with a description of what the video is about (Basically when they rollover the button).
The problem is that the image shows behind the external swf. I cannot get it to appear on top of the external swf. I have tried putting the buttons layer on top of the actions layer but that doesn't work.
I have not been using Flash for very long but I need to know if there is ActionScipt that can solve my problem or any other way to solve this issue. Please help. Thank you.
This is what appeared now in my Output panel.
Core_K12_Menu CS5.swf Movie Report
Metadata
Bytes Value
387 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/"> <xmp:CreatorTool>Adobe Flash Professional CS5</xmp:CreatorTool> <xmp:CreateDate>2010-07-25T19:31:59-07:00</xmp:CreateDate> <xmp:MetadataDate>2010-08-01T18:42:52-07:00</xmp:MetadataDate> <xmp:ModifyDate>2010-08-01T18:42:52-07:00</xmp:ModifyDate> </rdf:Description> <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"> <xmpMM:InstanceID>xmp.iid:2136C7DCCB9DDF11B1ACFFBB5C2D711F</xmpMM:InstanceID> <xmpMM:DocumentID>xmp.did:2136C7DCCB9DDF11B1ACFFBB5C2D711F</xmpMM:DocumentID> <xmpMM:OriginalDocumentID>xmp.did:423EF45B6198DF1180E5FB9309482BDA</xmpMM:OriginalDocumentID> <xmpMM:DerivedFrom rdf:parseType="Resource"> <stRef:instanceID>xmp.iid:992BC7CBB29DDF11B1ACFFBB5C2D711F</stRef:instanceID> <stRef:documentID>xmp.did:F34D8816A19DDF11ADEA81F4369F4B15</stRef:documentID> <stRef:originalDocumentID>xmp.did:423EF45B6198DF1180E5FB9309482BDA</stRef:originalDocumentID> </xmpMM:DerivedFrom> </rdf:Description> <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:format>application/x-shockwave-flash</dc:format> </rdf:Description> </rdf:RDF>
Frame # Frame Bytes Total Bytes Scene
1 295119 295119 Scene 1 (AS 3.0 Classes Export Frame)
Scene Shape Bytes Text Bytes ActionScript Bytes
Scene 1 0 0 1133
Symbol Shape Bytes Text Bytes ActionScript Bytes
ActiveMC 40 0 0
IntroModule 0 0 0
Module 1 Rollover 0 0 0
Module1 0 0 0
Module2 0 0 0
Module3 0 0 0
Module4 0 0 0
Module5 0 0 0
Module6 0 0 0
Module7 0 0 0
Module8 0 0 0
Module9 0 0 0
Module10 0 0 0
Module11 0 0 0
Module12 0 0 0
Module13 0 0 0
Module14 0 0 0
Module15 0 0 0
Module16 0 0 0
Module17 0 0 0
Module19 0 0 0
Module20 0 0 0
Module21 0 0 0
next_btn 0 0 0
replay_btn 0 0 0
Rollover 0 0 0
Rollover Image.psd 0 0 0
Symbol 18 0 0 0
Title.psd 0 0 0
ActionScript Bytes Location
1133 Scene 1:Frame 1
Bitmap Compressed Original Compression
Layer 1 3675 88264 JPEG Quality=80
Layer 1 3287 63936 JPEG Quality=80
Layer 1 1205 19668 JPEG Quality=80
Introduction-Up.jpg 6357 23200 Imported JPEG=102
Introduction-Down.jpg 5862 23200 Imported JPEG=102
Module 1-Up.jpg 5957 23200 Imported JPEG=102
Module 1-Down.jpg 5548 23200 Imported JPEG=102
Login Page and Tech Check Topics Covered - Introduction to A 4791 288576 JPEG Quality=80
Module 2-Up.jpg 6030 23200 Imported JPEG=102
Module 2-Down.jpg 5607 23200 Imported JPEG=102
Module 3-Up.jpg 6035 23200 Imported JPEG=102
Module 3-Down.jpg 5556 23200 Imported JPEG=102
Module 4-Up.jpg 5997 23200 Imported JPEG=102
Module 4-Down.jpg 5584 23200 Imported JPEG=102
Module 5-Up.jpg 6031 23200 Imported JPEG=102
Module 5-Down.jpg 5607 23200 Imported JPEG=102
Module 6-Up.jpg 6030 23200 Imported JPEG=102
Module 6-Down.jpg 5610 23200 Imported JPEG=102
Module 7-Up.jpg 5986 23200 Imported JPEG=102
Module 7-Down.jpg 5575 23200 Imported JPEG=102
Module 8-Up.jpg 6035 23200 Imported JPEG=102
Module 8-Down.jpg 5615 23200 Imported JPEG=102
Module 9-Up.jpg 6031 23200 Imported JPEG=102
Module 9-Down.jpg 5611 23200 Imported JPEG=102
Module 10-Up.jpg 6192 23200 Imported JPEG=102
Module 10-Down.jpg 5707 23200 Imported JPEG=102
Module 11-Up.jpg 6119 23200 Imported JPEG=102
Module 11-Down.jpg 5662 23200 Imported JPEG=102
Module 12-Up.jpg 6189 23200 Imported JPEG=102
Module 12-Down.jpg 5709 23200 Imported JPEG=102
Module 13-Up.jpg 6194 23200 Imported JPEG=102
Module 13-Down.jpg 5710 23200 Imported JPEG=102
Module 14-Up.jpg 6193 23200 Imported JPEG=102
Module 14-Down.jpg 5705 23200 Imported JPEG=102
Module 15-Up.jpg 6197 23200 Imported JPEG=102
Module 15-Down.jpg 5713 23200 Imported JPEG=102
Module 16-Up.jpg 6202 23200 Imported JPEG=102
Module 16-Down.jpg 5716 23200 Imported JPEG=102
Module 17-Up.jpg 6155 23200 Imported JPEG=102
Module 17-Down.jpg 5684 23200 Imported JPEG=102
Module 18-Up.jpg 6204 23200 Imported JPEG=102
Module 18-Down.jpg 5719 23200 Imported JPEG=102
Module 19-Up.jpg 6198 23200 Imported JPEG=102
Module 19-Down.jpg 5713 23200 Imported JPEG=102
Module 20-Up.jpg 6205 23200 Imported JPEG=102
Module 20-Down.jpg 5723 23200 Imported JPEG=102
Module 21-Up.jpg 6150 23200 Imported JPEG=102
Module 21-Down.jpg 5685 23200 Imported JPEG=102
Replay Button.jpg 5365 18240 Imported JPEG=102
Replay Button Down.jpg 4803 18240 Imported JPEG=102
Next Button.jpg 4965 18240 Imported JPEG=102
Next Button Down.jpg 4684 18240 Imported JPEG=102
Similar Messages
-
Can a javascript rollover in html call an external .swf?
I would like to change the code below to replace the target image with an external .swf.
It is now replacing the target with a gif, homePrintImage0.gif.
Is this possible?
<div><a href="#"onClick="MyWindow=window.open('popup.html','poppup','toolbar=no,location=no,direc tories=no, status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=500,left=50,top=50'); return false;"><img src="images/rollovers/thumbPrint_0_off.gif" width="17" height="16" alt="::" name="thumb0" id="thumb0" onMouseOver= "MM_swapImage('thumb0','','images/rollovers/thumbPrint_on.gif','target0','','images/targets/homePrintImage0.gif',1)" onMouseOut="MM_swapImgRestore()"/></a></div>
Thanks in advance.
KarenI was just thinking that if it's a super simple animation, a gif would work. of course if it's more complex, you might want the flash. Maybe you could make your whole menu flash?
-
How to place a movieclip on top of external swf
Hi there.
I have a main.swf in which i load a xml flash slideshow (.swf).
I want to place a menu which will be shown in front of the slideshow gallery.
I place the menu at an upper layer but the menu appears behind the slideshow.
Can anyone help with this and generally(i.e. in case i want to place something else on top or behind something else)
Thanks in advanceIf you were to replace that dynamically created empty movieclip with a manually created one placed in the timeline that would take care of the first suggestion I offered.
As for the the swapDepths usage and what you showed, you should be able to use something to the effect of... myGalleryContainer.swapDepths(myMenu);
If you want to see what depth am object resides at, you can use the getDepth() metod, as in... myMenu.getDepth(); -
How to place a transparent image on top of a panned object?
1) I have a group of image pasted inside a frame.
2) I applied a "Pan Only" to that frame.
3) I placed two gradient shapes ON TOP of this frame; one on the left side of the frame, and the other to the right.
4) When I preview the page, the frame jumps to the top of both gradient shapes, which is not what I want.
What am I doing wrong?
Thanks!It’s called an overlay for a reason.
Those gradients have to be turned into MSOs and placed above the pan only object.
There are details on how to do that in several areas of the forum.
I don’t have time right now for full details but if nobody has posted them by the morning I’ll pop back in.
Bob -
Hi all,
Two questions:
Once I place a rollover image in a webpage, how can I go back and modify the rollover image? Once I click the "OK" button in the Insert Rollover Image dialog box, it seems I can't pull this up again.
Also...is there a way to "copy" a rollover image from one webpage document to another and retain the functionality? I tried dragging and dropping the image, but it doesn't act like a rollover--it just shows the original image and retains the link.
Thanks in advance.Once I place a rollover image in a webpage, how can I go back and modify the rollover image?
DW can't modify a rollover image. You need to modify images in your graphics app. That's one of the big drawbacks to using images for menus or anything else that is likely to change during the life of your site.
For these and other reasons, I use CSS styled lists for navigation.
CSS Horizontal Drop Menu
http://alt-web.com/DEMOS/CSS2-Horiz-Drop-Menu.shtml
is there a way to "copy" a rollover image from one webpage document to another and retain the functionality?
Rollovers rely on JavaScript code in the <head> and <body> tags of your document. You would need to copy & paste all required code in Code View.
Or just use File > SaveAs > New-file-name.html.
See also -
Guidance on when to use DW Templates, Library Items and SSIs -
http://www.adobe.com/devnet/dreamweaver/articles/ssi_lbi_template.html
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
I have a weird glitch I can't figure out with one of my rollover images. I am using a smart shape as a button and have placed a rollover image over top of it so the two together will function as a rollover button like on webpages. The 'button' is grouped with two text areas and the group is placed on slide 1 with all four objects in the group defined as NOT visible in output, timed to display for entire project, and forced to be on top so it can function as a 'lightbox' effect with a close button. When I need this 'lightbox' with the text and the 'button' (smart shape button and image rollover), I SHOW the group through an advanced action. Once shown, the button functions as expected, and the button is programmed to go to the next slide. One slide 2, there is an OnEnter Event that hides the lightbox (and button in the group), along with other graphics to reset the slide graphics. The screenshot below is part of the lightbox with the offending button. When I mouseover the black button (smart shape being used as a button with a graphic fill), it swaps to an orange color
OK, so here's the weird part....I can open the lightbox without a problem. My 'button' shows up and the image swaps when the mouse hovers over. Beautiful. It disappears on mouseout. Perfect. I put my mouse over the button again and the image swaps to the over image perfectly again. I click the button and Captivate takes me to slide 2 and all the graphics hide (according to the OnEnter advanced action on slide 2) EXCEPT the rollover graphic. That graphic stays rendered on the screen until I go to the next slide and it gets hidden by the OnEnter advanced action for slide 3 (which is the same exact action as slide 2). The 'Next' Text is a text box with a link defined. The link has the exact same functionality defined as the button...go to the next slide. The screenshot below shows the result if I use the arrow button to go to the next slide. The orange arrow is left over from slide 1, and the black button (in the middle) is from slide 2.
Is there a reason that the mouseover image still renders? Is it because IO have my mouse over the image so it won't recognize the OnEnter Action telling it to disappear or something? I have other buttons with the exact same functionality that work just fine from slide to slide. It's only this one particular button that does it. I have replaced the rollover image, renamed the group (in both the slide and the advanced action), and even tried to create graphics to mask the weird functionality...to no avail.
Anyone out there have a suggestion of what to try? Oh...Using CP7, btw.My concern wasn't with the navbar, but thanks for the headsup.
The problem is that the link in the upper left hand corner, Suzie's Story, is a rollover image but it does not reveal the other image when the cursor goes over it.
<div id="topTabs1">
<div align="center"><a href="http://www.google.com" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('suzie','','Images/Suzie's Story Tab_light.jpg',1)"><img src="Images/Suzie's Story Tab_black.jpg" alt="suzie" name="suzie" width="75" height="45" border="0" id="suzie" /></a></div>
</div>
#topTabs1 {
width: 75px;
height: 45px;
float: left;
background-color: #ffffff;
padding-left: 0px;
padding-right: 0px -
Swf file causing rollover images not to work
I've inserted a Flash file into my webpage in Dreamweaver and it broke all my rollover images. Even deleting the swf file and reinserting the rollover images doesn't work. I've read a few threads on this but can't quite find exactly what I'm looking for. I think it's something in the <head> code but I'm not sure. Any help would be much appreciated!
<head>
<title>Matt Relstab | Still Photography | Moving Pictures | Sound Design</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
//-->
<meta name="keywords" content="natural light photography, media producer boston, online media, photographs, sound design, audio for film, web video, video production,
boston production, portable recorder, digital photography, digital media production">
</script>
<style type="text/css">
<!--
body {
background-color: #3f4450;
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>For starters, look at the first line on your errant page, it starts out:
<meta name="keywords" content="audio reel, foley artist, sound effects mixer, audio mixer
boston, sound engineer, post production">
<html>
Thats not good. If you look at your other pages, the <html> tag is first, the way it should be.
Switch them around, then try this, remove your <html> tag (the very first tag is where is should be) and replace it with this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
See what that does for you.
Gary
On Edit: I just noticed that you have
<meta name="keywords" content="natural light photography, media producer boston,
online media, photographs, sound design, audio for film, web video, video production,
boston production, portable recorder, digital photography, digital media production">
inside your js for the rollovers...Move them out of the script.
GAry -
Loading an external SWF from an external SWF
Hello,
I'm somewhat caught between a rock and a hard spot on a flash
site project. Here is the situation:
I have created a parent movie (which loads all external SWFs
inside of it) that has the menu navigation built into it. However,
my client wants me to place some more links inside of the external
SWFs that lead to other pages (external SWFs) of the site. Is this
at all possible? I was hoping there is a way to tell a button in an
external SWF to make the parent movie switch between external SWFs.
Any and ALL help is very much appreciated. Thank you.
Another question: does this involve using the _parent script?
ElijahHello,
Thank you for replying. Here is exactly what I'm needing to
do:
We will call the parent file "index.swf". Inside "index.swf"
I have a "holder" for external swf files to load into when I call
on them from the main menu buttons on "index.swf". When a customer
comes to the site, the "index.swf" file initially loads
"welcome.swf". Inside of "welcome.swf", I have some images that I
want to make into links to other external swf files.
My problem is when someone clicks on one of those pictures I
want the "index.swf" file to open up the corresponding external swf
file in its "holder", where "welcome.swf" currently resides. Also,
all of these swf files ("index.swf" included) have stand-alone FLA
files, none are attached to one another. I have never worked with
"levels" before, would that be necessary in this case? I have
attached the code for the external swf loader.
I hope that gives you a better idea of what I'm trying to
accomplish.
Thanks again.
Elijah
CODE: -
Loading external swf and Roll_OVER ROLL_OUT Events...
Hi.
Suppose the following scenario:
My application has some handlers attached for the rollover
and rollout events. the seem to work pretty fine. But i have to add
into my application an swf, so i add it using an Image Object. This
new Image Object containing my external swf file is into my
application. Now Roll_OUT event of my application fires when i
enter the swf Image Object, that is inside my application!!!
What am i doing wrong? I attach an example
Maybe that swf has events on it...
I am really confused about this behaviour in flexI sat typing into the quick reply, but this isn't sorry.
The issue here is that when you roll over another object
within the application it assumes that you have moved out of the
current object even if the new object is within the container of
the current object.
Hope that makes sense upto now. I had the same problem and
had to do this...
On mouse Over pr Rollover on internal object I run the stop
propogation and then restart the mouse over of the parent
container.
private function stopGadget(e:MouseEvent):void
// Stops the current mouse over running the parent container
mouse over. Then reloads the parent container for the gadget bar
(BIT OF A HACK)
e.stopPropagation();
Application.application.showTheGadget(e);
I think my comment sums it up a BIT of a Hack. -
Loading from library conflicts with loading external swf
I'm very new to ActionScript, so this might be incredibly basic. However, I've Googled and read myself into a coma and I'm not finding a solution.
I have a movie with 6 navigation buttons. Four of them load external .swf slideshows, and they work fine - as each file loads, the previous one clears the stage, etc. The other button that I currently have set up is loading, from the library, an image. The problem I'm having is that the slideshows replace each other on the stage - they're not stacking, they're replacing - but when the user selects the button that loads the image, the image overlays the last-selected slideshow. If the user selects the image first, the image is visible when two of the external files transition. Because of that 6th button, which is not yet even started, it's not desirable to me to simply set up the single image as another external file; if it's at all possible, I need to be able to pull from a library file when I build that last button.
What I'd like to do - because there is no logical order that the buttons should be selected in - is figure out how to tell every button to remove the image file on click. I've tried using this in the four buttons that link to the slideshows, to deal with the image (that's the one called quoteImage):
if(myLoader != null && contains(quoteImage)){
myLoader.removeChild(quoteImage);
which has the advantage of not giving me any errors, but doesn't actually fix my problem. I've tried many, many other things, and I'm just really stumped on what exactly I need to do to make this work the way I want it to. Based on the fact that the books and online resources I've been using don't really cover this specific example, I suspect it might be an incredibly idiot thing to do, but I'd really like it to work this way if that's possible.
The code as it stands, with the global variables and the first two buttons (the next three are identical to the second button and the sixth button doesn't exist) looks like this:
var myLoader:Loader=new Loader();
var quoteImage:Bitmap;
stop();
// Loads quoteImage from library
btnQuotes.addEventListener(MouseEvent.CLICK, showquote);
function showquote(event:MouseEvent):void {
var myBitmapDataObject:myBitmapData = new myBitmapData(500, 350);
var quoteImage:Bitmap = new Bitmap(myBitmapDataObject);
quoteImage.x=150;
quoteImage.y=180;
addChild(quoteImage);
// Loads industrial.swf from external file
btnIndustrial.addEventListener(MouseEvent.CLICK, showindustrialcontent);
function showindustrialcontent(event:MouseEvent):void {
var myURL:URLRequest=new URLRequest("industrial.swf");
myLoader.x=150;
myLoader.y=180;
myLoader.load(myURL);
addChild(myLoader);
Help is very much appreciated.I see now how to import and display a library class object
using:
var MovieClipClass:Class =
Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
var movieClip:Sprite = new MovieClipClass();
addChild(movieClip)
But this seems to only work for SWF's published for AS3 Flash
Player 9.
I need to do the same for SWF's published with AS2 Flash
Player 7.
Any ideas? -
AS3 load external swf problem, please help...
Hey guys, I am really in need of an answer here. I would tremendously grateful if someone has the answer. I'll keep it simple and right to the point:
1. I have created "index.swf" in AS3. Has it's own "MainClass" class.
2. I created "holder.swf" which is the main landing page. Has 2 buttons, for the viewer to load the site in fullscreen or standard.
3. In the timeline of "holder.swf" I have created 2 frames, 1st frame containing the buttons, second frame containing the AS3 external swf loader script.
It does not seem to want to load my "index.swf".
I have tested a million different ways, it load other swf's just fine, AS2 and AS3, but for some strange reason it just will NOT load "index.swf".
This is driving me crazy, I have a feeling it has something to do with a class conflict. I have tried (import MainClass;) in the first frame of "holder.swf" and no luck.
PLEASE GUYS, LET ME KNOW IF YOU KNOW THE ANSWER!
THANK YOU SO MUCHO.
MichaelHey kglad,
Thanks for the quick reply!
Well here is the problem... With the exception of a few things I need to update, as well as implementing some better preloaders etc... the site is running alright...
About a week ago I decided that I wanted to site to start with the above landing page. A simple "holder.swf" which would give the viewer something to look at before entering the site... (ideally I want to find a script that will begin loading "index.swf" while the viewer is still on "holder.swf", but I'll figure that out later).
Anyhow, I created "holder.swf" as I have many times before, and for some reason it does not seem to want to load "index.swf" into the second frame when instructed to do so... does that make sense?
So... ideally I would like the site to start on the above graphic, then once the button is clicked, "index.swf" opens up...
It's driving me crazy, because my code works on other swf's I've tested it with, just not with index.swf, which leads me to believe there is something in the MainClass.as file which is causing it not to load...
What are your thoughts?
Oh, and many thanks again!!!
M -
Hi there,
I've just added some external swf.'s to my site which contain
various slideshows and galleries which now don't work at all. I
understand that all the paths in my external swf.'s containing
_root will assume that the main timeline is now the _root movie, so
I wondered if there might be a quicker way of correcting all the
paths without having to go through each one individually as there
are literally hundreds!
Any help would be greatly appreciated. Many thanks.Hey batchas07,
Thanks for getting back to me. Erm, I'm pretty new to flash,
(the actionscript side of it anyway), so I didn't really follow
your first solution. I'm currently using Flash MX so would that
still work?
I read somewhere else to try the 'this._lockroot = true;'
script in the first frame of my external swfs. but this doesn't
seem to have done the trick either?
To give you a bit more of an idea, I'm building a site which
has five links at the bottom of the stage which each take you to a
different container movie clip, (each with an instance name of
'holder'), which each of the external swfs load in to. I'm using
the (loadMovie("external.swf", "holder") ) method of getting the
movies. All the movies load in fine, but as some of them are
slideshows with movie clips inside them I'm guessing their paths
will all be wrong which is why they don't work. The only way I have
managed to make the main movie recognize the external swfs is to
add 'holder.' after '_root.' to all the paths to buttons and movie
clips in these external swfs, but doing this to all of them will
take a long time.
Really not sure why the 'this._lockroot = true' method isn't
working out for me???
Thanks again for the help. -
Preloader that changes external swfs every 5 seconds
HI,
I've done an web banner in flash that loads an external swf
and changes for another external swf after 5 seconds. The banner
have a preloader, but the problem becomes when it loads the first
time. As the swfs aren't cached in the browser's cache yet, the
time for 5 seconds starts to count from the preloader, and when the
external swf finally shows, only rest 1 second and it is changed to
another. There is a way to "freeze" the time for each external swf
until it totally loads?
The code that loads the swfs every 5 seconds (this code is
placed into an action layer):
begin of code:
var intervalId:Number;
var count:Number = 0;
var maxCount:Number = 23;
var duration:Number = 0;
var banners:Array = new Array(
"abatrade.swf",
"bancobrasil.swf",
"caparao.swf",
"cedro.swf",
"cesama.swf",
"copasa.swf",
"damatta.swf",
"emtel.swf",
"engedrain.swf",
"extel.swf",
"feedback.swf",
"iti.swf",
"intermedium.swf",
"magnesita.swf",
"maquenge.swf",
"maxxdata.swf",
"orteng.swf",
"paiva.swf",
"paraibuna.swf",
"paraopeba.swf",
"sabesp.swf",
"serpro.swf",
"soll.swf",
"thawte.swf"
function executeCallback(param:String) {
var duration:Number = 5000;
loadMovie(banners[count],loadmovie_mc);
loadmovie_mc._x=0;
loadmovie_mc._y=0;
clearInterval(intervalId);
if(count < maxCount) {
count++ ;
intervalId = setInterval(this, "executeCallback", duration,
banners[count]);
else {
count=0;
intervalId = setInterval(this, "executeCallback", duration,
banners[count]);
if(intervalId != null) {
clearInterval(intervalId);
intervalId = setInterval(this, "executeCallback", duration,
banners[count]);
//end of code
And the code for the preloader (this code I place into the
movieclip that loads the external swfs):
//begin of code:
onClipEvent(enterFrame) {
var gtT:Number = this.getBytesTotal();
var gtL:Number = this.getBytesLoaded();
var gtP:Number = int((gtL/gtT)*100);
if ( gtT > gtL ) {
this._alpha = 0;
_root.loader._alpha = 100;
_root.loader.bar._width = gtP;
clearInterval(intervalId);
} else {
this._alpha = 100;
_root.loader._alpha = 0;
intervalId = setInterval(this, "executeCallback", duration,
banners[count]);
delete onEnterFrame;
//end of code
Note that I tryed to freeze the time using a clearInterval in
the second code, but it simply don't works...
Any Ideas? Thanks
Edsonhttp://www.maxxdata.com.br/banners.zip
Open the fla and preview the file with bandwidth preview (
Crtl+Enter twice ). You will note that the third banner
(caparao.swf) start to loads but it don't shows at all because the
loading for a slow internet (56K) takes more than 5 seconds. So the
loader skip to the next banner. Is there a way to "freeze" the time
for the preloader (to give it enough time to the banner load
completely, even in slow connections) and count the 5 seconds only
to the banner itself?
Thanks. -
Unload external SWF using event dispatch
Hi i am working on a flash website where i have a main movie named as Navigation where i have all the navigation buttons and drop menus. i am using switch case method to load multiples external SWFs. so as user clicks on any of the navigation button...it loads the external SWF
now i have a close_btn in the loaded SWF and i simply want the unload the external SWF when user clicks on the close_btn.
I come to know that i can do this by event dispach but i am not sure what code to put in external swf so when close_btn is clicked it can access the unloader function in main movie and unload the External SWF.
Could you Please help, Thank you !
this is my code
//--------main swf---------------------
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.*;
import flash.net.URLRequest;
home_btn.addEventListener(MouseEvent.CLICK,Click_To_Close);
ourstory_btn.addEventListener(MouseEvent.CLICK, clickHandler);
facility_btn.addEventListener(MouseEvent.CLICK, clickHandler);
customers_btn.addEventListener(MouseEvent.CLICK, clickHandler);
sustainability_btn.addEventListener(MouseEvent.CLICK, clickHandler);
contactus_btn.addEventListener(MouseEvent.CLICK, clickHandler);
// Dropdown Menu1 Buttons
menu1.menu_mc1.organicinitiative_btn.addEventListener(MouseEvent .CLICK, clickHandler);
menu1.menu_mc1.myhope_btn.addEventListener(MouseEvent.CLICK, clickHandler);
menu1.menu_mc1.target2015_btn.addEventListener(MouseEvent.CLICK, clickHandler);
// Dropdown Menu2 Buttons
menu2.menu_mc2.mens_btn.addEventListener(MouseEvent.CLICK, clickHandler);
menu2.menu_mc2.womans_btn.addEventListener(MouseEvent.CLICK, clickHandler);
menu2.menu_mc2.teans_btn.addEventListener(MouseEvent.CLICK, clickHandler);
menu2.menu_mc2.babies_btn.addEventListener(MouseEvent.CLICK, clickHandler);
var loader:Loader = new Loader();
addChildAt(loader,0);
function clickHandler(e:Event):void{
switch(e.target.name){
case "ourstory_btn": loader.load(new URLRequest("ourstory.swf")); break;
case "facility_btn": loader.load(new URLRequest("facility.swf")); break;
case "customers_btn": loader.load(new URLRequest("customers.swf")); break;
case "sustainability_btn": loader.load(new URLRequest("sustainability.swf")); break;
case "contactus_btn": loader.load(new URLRequest("contactus.swf")); break;
case "organicinitiative_btn": loader.load(new URLRequest("organicinitiative.swf")); break;
case "myhope_btn": loader.load(new URLRequest("myhope.swf")); break;
case "target2015_btn": loader.load(new URLRequest("target2015.swf")); break;
case "mens_btn": loader.load(new URLRequest("mens.swf")); break;
case "womans_btn": loader.load(new URLRequest("womans.swf")); break;
case "teans_btn": loader.load(new URLRequest("teens.swf")); break;
case "babies_btn": loader.load(new URLRequest("babies.swf")); break;
//-----------my unloader function in main swf --------------------
function Click_To_Close(event:MouseEvent):void
if(loader != null) {
loader.unloadAndStop();thank you
i have tried to use this.parent.Click_To_Close but it gives compilation error
i checked the tutorial about custom events i think its little complex for me now to understand the typeriter app.
also i cheked the similer thread and tried to test that code myself..i found that the last block of main movie does not works and does not unload the loader2. however all the trace are showing in the output windows that i added to check the code but last trace from the main movie is not showig...
trace("child removed from Main Movie")
so if this can work somehow i will use this method of event dispatch in my application that i am working...
Thank you
-----main movie ---------
var loader1:Loader = new Loader();
var loader2:Loader = new Loader();
loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, assignMovie1Listener);
loader1.load(new URLRequest("movie_1.swf"));
loader2.load(new URLRequest("movie_2.swf"));
addChild(loader1);
addChild(loader2);
function assignMovie1Listener(evt:Event):void {
MovieClip(evt.currentTarget.content).addEventListener("eventTriggered", removeLoader2);
trace("listner is listning..")
function removeLoader2(evt:Event):void {
loader2.unloadAndStop();
removeChild(loader2);
loader2 = null;
trace("child removed from Main Movie")
//------------- movie_1.swf code:
removeMovie2_btn.addEventListener(MouseEvent.CLICK , removeMovie2);
function removeMovie2(event:MouseEvent):void
dispatchEvent(new Event("eventTriggered"));
trace("event triggered form Child Movie-1");
as u can see when i click close button its triggering the trace from movie-1 but its not unloadign the movie2 -
PSD Rollover Button with image in front stops button from changing state
I have a wide PSD button that changes state when rolled over. I would like to place a PNG image with transparency in some areas over the top of it so that the rollover button shows through the transparent areas of the PNG.
How can you get it to do the rollover effect when the user mouses over the bit of the button that the image is in front of? Is ther a way of making the PNG 'invisible' to the mouse?
I know I could redesign the button so that it includes the image but I'm trying to keep file sizes and load times to a minimum, I use this button a lot on my website with a different on each, and having that number of individual buttons would result in a bloated, slow-loading website.Hi Abhishek
Thanks for your reply. I was able to achieve the effect I wanted by having the PNG and the PSD Button with the same link and then grouping them. This means I can mouse over the PNG and still get the PSD rollover effect, which is perfect.
However I also have another similar problem. I have some different PSD Rollover Buttons which have some text in front of them (basically it's the button label). On some of these buttons when you roll over the text it prevents the rollover state of the button, and on other buttons the rollover effect occurs as it should, and there doesn't appear to be any consistency about which does what. Grouping or ungrouping doesn't appear to make a difference. Can you help?
Maybe you are looking for
-
Err: The private key material is not exportable outside of the HSM
Hi, I am working on weblogic 8.1 with sp4, Using keytool generated certificates with HardwareSecurityModule (HSM) and enabled ssl in weblogic admin console. Now while starting the server following error is displayed <Oct 4, 2005 3:18:44 PM GMT+05:30>
-
My printer hooked itself up to someone else computer now I can wireless scan things to mine
My friend came over the other day and connected herself to my wireless internet. She has and HP I have a Mac. Since then any times she tries to print something I get it and anytime I try to scan something it goes to her email. I want to have it back
-
Values to be added in Listbox in modulepoolprogram
Hi, I have one listbox in my module pool program.. for thgis list box i need to add values like quarter...Halfyear and year how to add to this list box.
-
Problem in deleting Rows of JTable after sorting it
Hi all, I'm getting problems in Removing Row(s) after sorting a JTable. Please find the code snippets at this URL. Thanks for your time... http://forum.java.sun.com/thread.jsp?forum=31&thread=459736&start=15&range=15&hilite=false&q=
-
Wi-Fi settings in iPhone configuration profile not working
Hi there, if I apply the exact same iPhone configuration profile by using a USB cable and the iCU it works just fine and the Wi-Fi is starts to work immediately. If I upload the profile to the web and install it via a webpage everything works except