| Ultrashock Forums
• Full-Screen Centred Flash |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
| <12345>>> | Page 3 of 12 |
17 Creative Assets
|
2005-10-31
#81 |
||
|
|
2005-11-03
#82 |
||
|
Ok, got another question... I´ve noticed that the tiled background works, but it goes on top of anything I have on my flash...what should I do so it stays behind my other movieclips?
|
|
|
|
2005-11-03
#83 |
||
|
Ran into this problem a few days ago. I think it is back on page 1 of this thread but to refresh it. Load the tile bg as your main.swf and then create a empty mc and load your content into there. this.createEmptyMovieClip("mainContent_mc", 1); Hope that helps. Sorry I have a hard time explaining things as I am just learning them myself! |
|
17 Creative Assets
|
2005-11-03
#84 |
||
|
freeskier has beaten me to it. ![]() Just create an empty movieclip to contain the tiled shape, and then make sure that movie clip is placed behind everything else (the stuff you want in-front of the tiled shape). |
|
|
2005-11-23
#85 |
||
|
Hey Nutrox, is that last archive you posted still up to date? I seem to remember something about opera not supporting the object tag and IE not the embed tag or something. I hate html/css. It's just never clear to me. |
|
17 Creative Assets
|
2005-11-23
#86 |
||
|
Originally posted by Codemonkey It depends on how you prefer adding Flash to your page(s) to be honest. I've got into the habit of using the XHTML compliant way, which is why I only use the <object> tag (<embed> is not XHTML compliant).Hey Nutrox, is that last archive you posted still up to date? I seem to remember something about opera not supporting the object tag and IE not the embed tag or something. I hate html/css. It's just never clear to me. But... you shouldn't use the <object> tag that Flash generates because Flash assumes that you will be using the <embed> tag with it. If you only want to use the <object> tag then you need to use the type and data attributes with it... like this: Code:
<object type="application/x-shockwave-flash" data="myMovie.swf"> <param name="movie" value="myMovie.swf" /> </object> The simple way around that is to use a container movie (which I always do), and then load your main movie into that. The container movie will load up straight away (because it will be almost empty) and the main movie will then load in the normal way. You might do something like this: Code:
<object type="application/x-shockwave-flash" data="base.swf"> <param name="movie" value="base.swf" /> <param name="flashvars" value="clip=myMovie" /> </object> ActionScript Code:
The pros out weight the cons for me, so I don't use the <embed> tag now (stopped using it a while ago). Oh, as far as browser problems go then there aren't any (as long as you create the <object> tag correctly). It should work fine in any browser that supports Flash (has the plugin installed)... at least it does in IE, FF, NS, OP because they are the ones I test sites with.
|
|
|
2005-11-23
#87 |
||
|
Excellent, exactly what I needed to know. |
|
|
2005-12-01
#88 |
||
|
Hi, I posted in this thread before with some questions about fullscreen flashsites and the involvement off scrolling in them... But I didnt really find what I was looking for.. till Now! This site is great, http://www.amberfly.com/main/index.html But how it works? It is flash fullscreen.. with a maincontent that aligned's and a footer that moves with your screen how you resize it... BUT when your screen is getting smaller than de content of the site both scrollbars(html)appear!... sow this is much different then just making your html page set to a number of hight, so scrolling appears when your screen is smaller then.. px. tryed this but then my content doesnt aligned's anymore.. Anyone knows something about this theorie, and has an idee how it works? |
|
17 Creative Assets
|
2005-12-01
#89 |
||
|
Originally posted by igor You must be doing something wrong, I've never had any problems with it. All you need to do is set the size of the Flash movie to match the size of your content, and the HTML scrollbars will appear automatically if the Flash movie is bigger than the browser window.Hi, I posted in this thread before with some questions about fullscreen flashsites and the involvement off scrolling in them... But I didnt really find what I was looking for.. till Now! This site is great, http://www.amberfly.com/main/index.html But how it works? It is flash fullscreen.. with a maincontent that aligned's and a footer that moves with your screen how you resize it... BUT when your screen is getting smaller than de content of the site both scrollbars(html)appear!... sow this is much different then just making your html page set to a number of hight, so scrolling appears when your screen is smaller then.. px. tryed this but then my content doesnt aligned's anymore.. Anyone knows something about this theorie, and has an idee how it works? Here's the code again: html Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<title>My Page</title>
<script type="text/javascript">
var ie = navigator.appName.indexOf("Microsoft") > -1;
function setSize(width, height)
{
var o = (ie) ? window["flashMovie"] : document["flashMovie"];
o.style.width = width;
o.style.height = height;
}
</script>
<style type="text/css">
html, body
{
margin:0px;
padding:0px;
}
object
{
width:100%;
height:100%;
}
</style>
</head><body>
<object id="flashMovie" type="application/x-shockwave-flash" data="movie.swf">
<param name="movie" value="movie.swf">
</object>
</body></html>
ActionScript Code:
Hope that helps. |
|
|
2005-12-01
#90 |
||
|
Thanx Nutrox, for helping so fast! I have tryed it exactly like you showed to do, here's and example .. but it doesnt work, but that's probably because I'm forgetting to do something with the import flash.external.*;?? Not formiliar with that so much have done it in flash 8 btw. Hope you have any sugestions? |
|
17 Creative Assets
|
2005-12-01
#91 |
||
|
If you are testing the movie off-line (ie. from your desktop) then you will probably need to add <param name="allowScriptAccess" value="always" /> into the <object> element. You can remove that when you upload the files to the server. Here's an online example of the movie resizing. Here are source files.
|
|
|
2005-12-01
#92 |
||
|
|
2005-12-01
#93 |
||
|
hmm i dont get it... If you make your movie say 400 high in the var newHeight:String, It loses it ability to keep (the myContent_mc)aligned till the hight of 400px, and it makes the whole movie including the bg color 400 high. Understand what I mean? btw,Nutrox thanx for the help so far.. igor |
|
17 Creative Assets
|
2005-12-01
#94 |
||
|
Originally posted by igor That's because you're setting the movie height to 400px. If you want the movie to fill the browser window then set the height to 100%.hmm i dont get it... If you make your movie say 400 high in the var newHeight:String, It loses it ability to keep (the myContent_mc)aligned till the hight of 400px, and it makes the whole movie including the bg color 400 high. It sounds like you want the movie to be 100% when the content doesn't exceed the height of the browser window, and set the movie height to match the height of the content when it exceeds (overflows) the browser window. If you want to do that then you can update the JavaScript with this: Code:
<script type="text/javascript">
var ie = navigator.appName.indexOf("Microsoft") > -1;
function setSize(height)
{
var o = (ie) ? window["flashMovie"] : document["flashMovie"];
o.style.height = (height < getHeight()) ? "100%" : height + "px";
}
function getHeight()
{
if(window.innerHeight)
{
return window.innerHeight;
}
else if(document.body.clientHeight)
{
return document.body.clientHeight;
}
}
</script>
ActionScript Code:
|
|
|
2005-12-01
#95 |
||
|
Oww sorry for my absence, Well its like this site.. On my 1280-1024px reso screen fullscreen, the content stays centered. When i'm sliding my window-height up it stays centered(without scrollers) untill the window gets the height where te content should slide outside the window. Thats where the content should stop at the top and the scrollers shoud appear. So the height of where the scrolling should appear is the height of the content, wich dont have to be calculated, just been said. sorry if i'm so difficult This way just sounds very good, so your fullscreen sites dont slide outside the explorer window when the window is getting to small. igor |
|
17 Creative Assets
|
2005-12-01
#96 |
||
|
Originally posted by igor You do need to calculate how much space your content takes up. JavaScript has no way of knowing how much space your movie content uses, there's no magical way of doing this.... So the height of where the scrolling should appear is the height of the content, wich dont have to be calculated, just been said ... The easiest thing for you to do would be to put all of your content inside a movie clip, and then pass the height of that movie clip to JavaScript whenever you change anything that will affect the height of the movie clip. Everything you need is in this thread, but here is one last example: Online example Source files If that doesn't help you then nothing will.
|
|
|
2005-12-02
#97 |
||
|
that's what I wanted!! Thank you very much Nutrox for making some time to help on this.. Now I have to sit back and see how you did all this things
|
|
|
|
2005-12-02
#98 |
||
|
Nutrox you are a genius. How do I call the ExternalInterface.call from a MC that is embedded into another mc? Do I just call ExternalInterface.call or would I have to go with _root.ExternalInterface.call sort of thing?
|
|
17 Creative Assets
|
2005-12-02
#99 |
||
|
Originally posted by freeskier You need to import the class into the frame you want to use it in...Nutrox you are a genius. How do I call the ExternalInterface.call from a MC that is embedded into another mc? Do I just call ExternalInterface.call or would I have to go with _root.ExternalInterface.call sort of thing? ActionScript Code:
If that doesn't make sense then let me know and I will try to explain it a bit better. ![]() Oh, and don't forget about the "allowScriptAccess" parameter if you are testing the movie from your desktop (ie. not from a server)...
If you are testing the movie off-line (ie. from your desktop) then you will probably need to add <param name="allowScriptAccess" value="always" /> into the <object> element. You can remove that when you upload the files to the server.
|
|
|
|
2005-12-02
#100 |
||
|
Thanks for replying so fast. That makes total sense and while reading your reply I relized I was going about it all wrong. But why won't this work? function updateSize(newHeight):Void { ExternalInterface.call("setSize", "100%", newHeight); } updateButton.onRelease = updateSize(1000px); Keeps giving me an error that a ')' is expected |
|
17 Creative Assets
|
2005-12-02
#101 |
||
|
Try this... ActionScript Code:
|
|
|
|
2005-12-02
#102 |
||
|
Oh JEEEEZ. Didn't catch that one - thanks again man.
|
|
|
|
2005-12-02
#103 |
||
|
Ok last question Nutrox. With the above example how can I specify between percentage and px? So I can go like updateSize(1000px); or updateSize(100%); Thanks a ton for all your help |
|
|
|
2005-12-02
#104 |
||
|
LOL - answered my own question. I swear my brain only works while I post a question Anyway for anyone curious I took this route.updateSize(1000); - when you want to specify px updateSize(100+"%"); - for percentages Still gettin my head around AS so sorry for all the posts. |
|
|
|
2005-12-14
#105 |
||
|
hi..my first submission here...sorry if it is not in the correct place but nutrox seems to have good knowledge of what i am trying to accomplish. i am trying to do what is being done on http://www.budlight.com/index.html under tv ads. i ma trying to get a button when moused over to play the clip, one mousedown to load the clip to the default clip stage on the left.. i have been having troubles even getting one button to do this..can you point me in the right direction.. |
|
|
|
2005-12-14
#106 |
||
|
i also have a question as to how big a video file can be in flash..is there too large a size to place in a library? and is flv the only type which can be played in flash? and is it to be given an instance name and called from the library or is there another way to link to video as we will probably have 30 or 40 videos..sorry for so many questions...used to working with asp, vb and sql so i am trying to pick this up as quickly as i can } |
|
17 Creative Assets
|
2005-12-14
#107 |
||
|
Originally posted by gregmo To do this you need to give your button an "instance name". If you open up Flash and click on your button so that it's highlighted, then have a look at the Properties panel, you should see a text input near the top-left of the panel (below the drop down menu)... that's where you can give your button it's name.hi..my first submission here...sorry if it is not in the correct place but nutrox seems to have good knowledge of what i am trying to accomplish. i am trying to do what is being done on http://www.budlight.com/index.html under tv ads. i ma trying to get a button when moused over to play the clip, one mousedown to load the clip to the default clip stage on the left.. i have been having troubles even getting one button to do this..can you point me in the right direction.. If you have called your button myButton for example then you can attach code to it like this: ActionScript Code:
ActionScript Code:
Originally posted by gregmo It's probably a good idea to keep all of your videos external from the Flash movie, and load them into Flash when you need to... that way your video file sizes can be a large as you need them to be.i also have a question as to how big a video file can be in flash..is there too large a size to place in a library? and is flv the only type which can be played in flash? and is it to be given an instance name and called from the library or is there another way to link to video as we will probably have 30 or 40 videos..sorry for so many questions...used to working with asp, vb and sql so i am trying to pick this up as quickly as i can FLV is the best video format to use with Flash (Flash 8 comes with a great encoding tool), and you can load your FLV videos into Flash at runtime using the NetConnection and NetStream classes (check out the Flash Help docs for more info on those). Here's an example I've just pulled from the help docs: The following code first constructs a new NetConnection object, connection_nc, and uses it to construct a new NetStream object called stream_ns. Select New Video from the Library options menu to create a video object instance, and give it an instance name my_video. ActionScript Code:
|
|
|
|
2005-12-15
#108 |
||
|
Last edited by Gromslab : 2005-12-17 at 17:49.
Where from to get all these Robert Penners tween classes for repositioning with easing ?... for flash 8
|
|
|
|
2005-12-29
#109 |
||
|
hello. i'm new here.i ran into this thread when trying to figure out what was wrong with my attempts to center flash correctly. i wonder if you can help me also... i seem to have exactly the same problem that uxte had a while back: when resizing screen, the content mc gets glued to the top. but did you guys find any solution to the problem? i haven't found any anywhere...! what was wrong with the code..? the code i'm using has slight differences to the one presented here. my movie that contains all the main content is called just 'content'. then i have an mc called 'bg' that it always supposed to stretch to fit entire screen while content mc stays unscaling in the center of the screen. or, that is how they are supposed to behave... here's my code... i'd really appreciate help!!! Code:
Stage.scaleMode = "noScale";
Stage.align = "LT";
bg.onResize = function() {
this._width = Stage.width;
this._height = Stage.height;
};
(onResize)
Stage.addListener(bg);
bg._x = bg._y = 0;
bg.onResize();
content.onResize = function() {
this._x = (Stage.width - this._width) / 2;
this._y = (Stage.height - this._height) / 2;
};
Stage.addListener(content);
content.onResize();
|
|
|
|
2005-12-29
#110 |
||
|
i add a little to the previous post: i tried now with the code presented here. the problem still persists! i've been looking eeeeeverywhere for a solution. hours, days... i'd be forever grateful if someone could give me a hint of what is going on! why does my content mc get stuck to the top while resizing??? what might be causing that? thanks a million for sharing your wisdom...
|
|
17 Creative Assets
|
2005-12-29
#111 |
||
|
The main problem is that you are not using listener objects correctly. I won't explain how listeners work here, but if you do a search in the Flash Help docs for "Stage.addListener", you should find a good explanation of how to use listener objects. Here's a new version of your code that should work: ActionScript Code:
|
|
|
|
2005-12-29
#112 |
||
|
Last edited by BalaFo : 2005-12-29 at 16:18.
hi there! thank you for you quick response! ![]() umm, it does not really help... i tried with this new code. but the content mc still eventually ends up at the top of screen when you resize the screen. not always at first attempt, though, but on second or third at the latest. as if the listeners would stop listening at some point. is this how it should be? i'm quite new to flash, still learning... but this problem is funny, though. looks like if i don't have anything in the content mc, the code works ok. seems like once i start loading other swf's in, this odd problem starts. i load those other swf's on an empty mc in content mc. can this be causing the behaviour? ...and now i've had time to experiment with all the codes i copied and pasted from this thread's earlier discussions. always the same thing: as soon as i click the full screen/partial screen button in my browser, the content mc jumps up at the top of the screen and stays there. ohh, i'd give my heart and half of the kingdom to the one who can kill this bug...!!!
|
|
|
|
2006-01-04
#113 |
||
|
hello again, i'm still here... by now i've tried eeeeeeeverything i can think of. please, if you've got any ideas of how to help me forward, i'd cry tears of relief!!! so. i've localized the problem now. it is like i said earlier: the code works fine before i load any other swf's into the content mc. as soon as i do that, the listeners start acting weird and the content mc won't stay in the center any longer. my content mc's measures are 790x450 pixels, same as my main swf's. i'm loading the swf's into empty mc that i've placed in the 0,0 corner of the content mc. i have created my main swf with huge amount of work... but how can i use it now?? what am i doing wrong? how should i load the other swf's into content mc, then, if this is not the way? i've tried all logical and even illogical solutions... please help, if you can! advice, tips, something... i'm desperate!!!
|
|
17 Creative Assets
|
2006-01-04
#114 |
||
|
Hi, mate. I'm putting some FLA example files together for you now. They should give you a better idea of how to approach things, and I will include code to load an external SWF file into the content/container movie clip. Won't be long.
|
|
17 Creative Assets
|
2006-01-04
#115 |
||
|
Done. Have a look at this: Online Example Source Files - ZIP The code I used in the main movie is: ActionScript Code:
|
|
|
2006-01-04
#116 |
||
|
Cool ! We're all waiting !!!
|
|
|
2006-01-04
#117 |
||
|
Hey Nutrox... This is great !!!!! ![]() Do you think you could make an example with a repeating background ? In my case... The bts are in the movie clip loaded in the main one... Tks in advance !!! ![]() Hugo |
|
|
|
2006-01-05
#118 |
||
|
wowww.....! THAT got my hopes up in one go looks great!i'll have to go away now, but as soon as i've been able to give it a try i'll let you know how it went. thank you!!!!! |
|
|
|
2006-01-05
#119 |
||
|
all right! aaaaaaaaah. now the thing behaves itself. i still don't understand what went wrong with my previous attempt. as far as i can understand it should have been correct... but this one works loke a dream, so i'll stick with it and just skip the understanding bit for the time being one million three hundred thousand and eighty-seven thanks to you for coming to my rescue!!! this saved my site design - and a huge amount of work. i'm grateful for ever. |
|
|
2006-01-05
#120 |
||
|
You're a machine Nutrox. This thread will have you pooping code until the end of days
|
|
| <12345>>> | Page 3 of 12 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


17 Creative Assets

Linear Mode
Hi Nutrox! I got a question for u...
The code explaining how to create a tiled bg u posted is only
for flash 8? I cant get it to work....
You can then attach that image to a BitmapData object and use it to fill a shape drawn with the Flash drawing API.
For example, the following code will draw a tiled 200x200 box in myMovieClip.