Go Back   Dynamic Drive Forums > General Coding > Flash
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-20-2006, 05:40 PM
Null Null is offline
Junior Coders
 
Join Date: Aug 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default Flash button with popup question

Hi,

I have the following code for my flash button:
Code:
on (release) {
getURL ("javascript:NewWindow=window.open('http://www.test.nl','newWin','width=400,height=300,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No');  NewWindow.focus();      void(0);");
}
This creates a popup window from the flash button. Now it loads a picture in this popup, but is it possible to make this an invisible popup? So that you see no borders, only the picture, so invisible borders.

Perhaps a transparent draggable block that loads the picture in it...

Null
Reply With Quote
  #2  
Old 09-21-2006, 02:45 AM
BLiZZaRD's Avatar
BLiZZaRD BLiZZaRD is offline
Elite Coders
 
Join Date: Aug 2005
Location: Other Side of My Monitor
Posts: 3,158
Thanks: 1
Thanked 62 Times in 62 Posts
Default

You are speaking of chromless windows and no, because of security issues no browser supports them.

Your other option is to load the pop up inside your main movie and sort of "fake" it.
Reply With Quote
  #3  
Old 09-21-2006, 09:19 AM
Null Null is offline
Junior Coders
 
Join Date: Aug 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

And how would I do that?

Or is it possible to not make a javascript popup but a dhtml popup? All from the button ofcourse
Reply With Quote
  #4  
Old 09-21-2006, 09:39 AM
BLiZZaRD's Avatar
BLiZZaRD BLiZZaRD is offline
Elite Coders
 
Join Date: Aug 2005
Location: Other Side of My Monitor
Posts: 3,158
Thanks: 1
Thanked 62 Times in 62 Posts
Default

No, what you would do is make your pop up a movie clip instead of a separate file. Then add code to the MC to close on click, or make another button on the pop up.

On your button you would put the code to open the MC.

To have a picture load in the pop up you would just make the MC an empty MC with an array to scroll through the pictures, or to load a random one each time the button is clicked.

I am at work and this is a rather complicated coding process... I will try to look through my online file to find it as I have done this a few times. I will try to post back soon with some useful snippets for you.
Reply With Quote
  #5  
Old 09-21-2006, 12:04 PM
BLiZZaRD's Avatar
BLiZZaRD BLiZZaRD is offline
Elite Coders
 
Join Date: Aug 2005
Location: Other Side of My Monitor
Posts: 3,158
Thanks: 1
Thanked 62 Times in 62 Posts
Default

Okay, I can't access the pop up codes I was reffering to above.

However, as with almost anything in Flash, there is yet another way. Allbeit this wont be as pretty as the original idea, you can tweak and poke and adjust each frame I describe here to your exact liking, instead of forming each thing to a 300400 square.

Okay, lets describe this process:

1. Open your movie and create a new Movie Clip, registration point center, give it a name.

2. edit the MC adding a blank keyframe for each picture you would like to display. For the length of this post we will stick with one picture to show in the popup.

So we have a MC with 2 blank keyframes. Next you need to add another layer to the MC, call it "scripts" or the like, and in Frame 1 of the Scripts layer put this code:

Code:
stop();
Go back to layer 1, Frame 2, and now bring in your picture you want to show in the "pop up" Adjust it how you like, size, shape, colors, etc **

when that is done, go back to your main timeline and the next step:

4. Drag your MC from the library to the stage where ever you would like the "pop up" to show up. Keep in mind you have NOTHING in the first frame of this MC, so you wont be able to see it. Use the registration point when dragging to help guide you where to place it.

5. Once it is placed on the stage add this code to the BUTTON you want to use to open the "pop up"

Code:
on(release){
nameOfMovieClip.gotoAndStop(2);
}
Basically that is it. Now you have a button that will take your MC to the frame where you loaded the picture and it will just "appear" giving the effect of a pop up. Now we just need to jazz it up a bit.

You can do a few things here, first we will need to remove the pop up. The EASIEST (and most boring) way is to make another button with the following code:

Code:
on(release){
nameOfMovieClip.gotoAndStop(1);
}
Obviously this will take the MC back to the black frame and thus give the effect of "closing" the pop up.

However, too many buttons might just be something you don't want. We can use AS to keep a "click count" and reset the count to 0 when we want the pop up to disappear.

You could also make a frame counter (if you have multiple pics to show in one pop up) and do a random array and show a random pic on each click, which you could make cycle through each picture and then "close" by going to frame 1 (the balnk one)

Many options.

** You also have the option of creating a second MC in which you can make tweens and effects or splashes, etc, then just drag that MC into Frame 2 of this MC. Doing so will make the pop up appear when the button is clicked, and it will then play the tweens or whathaveyou of the secondary MC
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:40 PM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.