ایجاد حالت تمام صفحه Fullscreen در صفحات HTML

shabanet

New Member
دوستان و اساتید محترم ، من نمونه هایی از سایتهایی رو دیدم که دکمه ای برای تمام صفحه نشان دادن داشتند . البته ظاهرا با fullscreen سنتی فلش متفاوت بود چون کلیپی که در یک صفحه htmlدر حال اجرا بود با کلیک آن دکمه مانند یک مالتی مدیا که تمام صفحه باشد بادستور fscommand("fullscreen", "true"); fullscreen شده و دوباره با کلیک همان دکمه و یا زدن دکمه Esc به حالت اجرا درون صفحه html بازمیگشت .
لطفا به این نکته توجه داشته باشید که هدف تمام صفحه شدن یک فایل swf یا exe به تنهایی نمی باشد و در حقیقت من به دنبال تمام صفحه اجرا شدن کلیپ فلش از درون یک مرورگر وب هستم.نمونه های این دکمه را من در سایتهایhttp://www.limoosoft.com و http://www.pmc.tv دیدم
خواهشمند است در صورت امکان من رو هر چه سریع تر راهنمایی کنید.
 

shabanet

New Member
کسی نیست این مسئله رو بدونه ؟؟؟؟ کمک

دوستان ، یعنی کسی نیست که بتونه منو راهنمایی کنه . ؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟:shock::razz:
 

flash man

Member
سلام رفیق
سایت لیمو سافت که فول فلش و چیزی به عنوان فول اسکرین نداره که بخواد تیتل بارو حذف کنه
من منظور شما رو نفهمیدم
اگه بیشتر توضیح بدبن ممنون می شم
 

shabanet

New Member
flashman عزیز ، منظورم اینه که دکمه ای در فلش طراحی میشه که با زدنش کلیپ در حال اجرا کاملا از صفحه مرورگر خارج شده و مانند یک مالتی مدیای تمام صفحه اجرا می شود.ضمنا سایت لیموسافت تمام فلشه اما در گوشه بالا سمت چپ آیکنی برای تمام صفحه شدن داره که در صورت کلیک کلیپ به جای مرورگر در کل صفحه اجرا می شه.

آونگ عزیز ، سایتی که معرفی کردین رو دیدم ، اما منظورم این نبود.در این سایت با دستور جاوا صفحه html تمام صفحه شده که کلیپ هم در اون اجرا میشه و هنوز بالای مرورگر هم وجود داره اما نمونه ای که من دنبالشم با زدن دکمه در کلیپ فلش کل کلیپ از مرورگر بیرون اومده و تمام صفحه اجرا می شه . البته از معرفی این سایت کمال تشکر رو دارم.

محسن جان ، امیدوارم منظورمو تونسته باشم شرح بدم ، و در صورتی که می دونی چطور می شه چنین چیزی رو اجرا کرد ، بی صبرانه منتظر راهنماییتم.
 

mohsensemsarpour

کاربر فعال
سلام دوست عزیز
ببینید در مورد سوالتون تا اون جایی که من متوجه شدم شما قصد دارید یک فلش رو درون یک html قرار بدید و وقتی دکمه ای از اون فلش زده شد برنامه ie بسته بشه (یا نشه) و فلش جدید به حالتی که روش دوبار کلیک می شه باز بشه
در این مورد باید خدمتتون عرض کنم از اون جایی که فایل فلش شما روی سرور قرار داره تنها راهی که وجود داره (البته با توجه به معلومات من) اینه که شما توی یه صفحه html دیگه اون رو باز کنید اما (customize) کنید
به همین علت شما نمی تونید فایل رو به صورت جدا باز کنید مگر اینکه اون رو روی سیستم افراد منتقل کنید و با استفاده از دستورات خواص اون رو از روی سیستم اجرا کنید

نمی دونم تا چه حد متوجه شدم (به بزرگی خودتون ببخشید) !
 

shabanet

New Member
بله. حرف شمامتین ، من هم دقیقا همین فکر رو می کردم ، البته قبل از اینکه اون 2 نمونه ای که گفتم رو ببینم که البته هر 2 نمونه هایی ایرانین . پس مطمئنا نمونه های دیگه ای هم با ید باشن.منظورم همون سایت pmc و لیموسافت که اول مطالب مثال زدم . انتقال در این 2 کلیپ بر روی سیستم رو بعید می دونم چون همون لحظه که دکمه رو میزنی کلیپ تمام صفحه می شه.البته من فکر می کنم که کلیپ زمانی که داره اجرا می شه در حقیقت روی سیستم کاربر منتقل شده با این که داره همچنان در مرورگر اجرا می شه و شاید طراح با ترفندی داره از این موضوع استفاده میکنه که البته این امکان قدری بعیده . خواهشی که دارم ممنون می شم شما هم 2 نمونه ای که معرفی کردم بینین شاید اینجوری بتونم منظورم رو بهتر درک کنین.
ضمنا این مورد نباید آنچنان هم کاری معمولی باشه چون من سایت ها و انجمن های آموزشی فلش رو گشتم ولی ظاهرا در این مورد چیزی ندیدم (به جاش کلی مطلب درباره fullscreen خودفایل فلش دیدم که هر دفعه نقش سراب رو در جستجوها داشت )
 

mohsensemsarpour

کاربر فعال
سلام دوست عزيز
من سايت ها رو ديدم انشاء الله سعي مي كنم به زودي راهي پيدا كنم (آره محسن تو گفتي منم باورم شد خالي چرا مي بندي براي مردم) به هر حال تمام سعيم رو مي كنم.

موفق باشيد
 

shabanet

New Member
ممنون می شم اگه واقعا کمک کنی . کد به درد بخوریه اگه پیداش کنیم . میتونه برای سایتهای تمام فلش کارساز باشه و کار کلی بنده خدا (که اولیش خودمم) راه بندازه
 

fafa^mx

Member
[ltr]
Check out the reference before asking any dumb question, and getting dumb answers!

Programming ActionScript 3.0


Display programming > Working with display objects > Setting Stage properties





Setting Stage properties
The Stage class overrides most properties and methods of the DisplayObject class. If you call one of these overridden properties or methods, Flash Player throws an exception. For example, the Stage object does not have x or y properties, since its position is fixed as the main container for the application. The x and y properties refer to the position of a display object relative to its container, and since the Stage is not contained in another display object container, these properties do not apply.

NOTE

Some properties and methods of the Stage class are not available to display objects that are not in the same security sandbox as the first SWF file loaded. For details, see Stage security.


Subtopics
Controlling the playback frame rate

Controlling Stage scaling

Working with full-screen mode

Controlling the playback frame rate
The framerate property of the Stage class is used to set the frame rate for all SWF files loaded into the application. For more information, see the ActionScript 3.0 Language and Components Reference.

Controlling Stage scaling
When a Flash Player screen is resized, Flash Player automatically adjusts the Stage contents to compensate. The Stage class's scaleMode property determines how the Stage contents are adjusted. This property can be set to four different values, defined as constants in the flash.display.StageScaleMode class.

For three of the scaleMode values (StageScaleMode.EXACT_FIT, StageScaleMode.SHOW_ALL, and StageScaleMode.NO_BORDER), Flash Player will scale the contents of the Stage to fit within its boundaries.The three options differ in determining how the scaling is accomplished:

StageScaleMode.EXACT_FIT scales the SWF proportionally.
StageScaleMode.SHOW_ALL determines whether a border appears, like the black bars that appear when viewing a wide-screen movie on a standard television.
StageScaleMode.NO_BORDER determines whether the content can be partially cropped or not.
Alternatively, if scaleMode is set to StageScaleMode.NO_SCALE, the Stage contents maintain their defined size when the viewer resizes the Flash Player window. In this scale mode only, the width and height properties of the Stage class can be used to determine the actual pixel dimensions of the resized Flash Player window. (In the other scale modes, the stageWidth and stageHeight properties always reflect the original width and height of the SWF.) In addition, when scaleMode is set to StageScaleMode.NO_SCALE and the SWF file is resized, the Stage class's resize event is dispatched, allowing you to make adjustments accordingly.

Consequently, having scaleMode set to StageScaleMode.NO_SCALE allows you to have greater control over how the screen contents adjust to the window resizing if you desire. For example, in a SWF containing a video and a control bar, you might want to make the control bar stay the same size when the Stage is resized, and only change the size of the video window to accommodate the Stage size change. This is demonstrated in the following example:

// videoScreen is a display object (e.g. a Video instance) containing a
// video; it is positioned at the top-left corner of the Stage, and
// it should resize when the SWF resizes.

// controlBar is a display object (e.g. a Sprite) containing several
// buttons; it should stay positioned at the bottom-left corner of the
// Stage (below videoScreen) and it should not resize when the SWF
// resizes.
PHP:
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;

var swfStage:Stage = videoScreen.stage;
swfStage.scaleMode = StageScaleMode.NO_SCALE;
swfStage.align = StageAlign.TOP_LEFT;

function resizeDisplay(event:Event):void
{
    var swfWidth:int = swfStage.stageWidth;
    var swfHeight:int = swfStage.stageHeight;

    // Resize the video window.
    var newVideoHeight:Number = swfHeight - controlBar.height;
    videoScreen.height = newVideoHeight;
    videoScreen.scaleX = videoScreen.scaleY;
    
    // Reposition the control bar.
    controlBar.y = newVideoHeight;
}

swfStage.addEventListener(Event.RESIZE, resizeDisplay);

Working with full-screen mode
Full-screen mode allows you to make a SWF fill a viewer's entire monitor, without any borders, menu bars, and so forth. The Stage class's displayState property is used to toggle full-screen mode on and off for a SWF. The displayState property can be set to one of the values defined by the constants in the flash.display.StageDisplayState class. To turn on full-screen mode, set displayState to StageDisplayState.FULL_SCREEN:
PHP:
// mySprite is a Sprite instance, already added to the display list
mySprite.stage.displayState = StageDisplayState.FULL_SCREEN;


To exit full-screen mode, set the displayState property to StageDisplayState.NORMAL:

mySprite.stage.displayState = StageDisplayState.NORMAL;

In addition, a user can choose to leave full-screen mode by switching focus to a different window or by using one of several key combinations: the Esc key (all platforms), Ctrl-W (Windows), Command-W (Mac), or Alt-F4 (Windows).

Stage scaling behavior for full-screen mode is the same as under normal mode; the scaling is controlled by the Stage class's scaleMode property. As always, if the scaleMode property is set to StageScaleMode.NO_SCALE, the Stage's stageWidth and stageHeight properties change to reflect the size of the screen area occupied by the SWF (the entire screen, in this case).

You can use the Stage class's fullScreen event to detect and respond when full-screen mode is turned on or off. For example, you might want to reposition, add, or remove items from the screen when entering or leaving full-screen mode, as in this example:
PHP:
import flash.events.FullScreenEvent;

function fullScreenRedraw(event:FullScreenEvent):void
{
    if (event.fullScreen)
    {
        // Remove input text fields.
        // Add a button that closes full-screen mode.
    }
    else
    {
        // Re-add input text fields.
        // Remove the button that closes full-screen mode.
    }
}

mySprite.stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenRedraw);

As this code shows, the event object for the fullScreen event is an instance of the flash.events.FullScreenEvent class, which includes a fullScreen property indicating whether full-screen mode is enabled (true) or not (false).

When working with full-screen mode in ActionScript, you'll want to keep the following considerations in mind:

Full-screen mode can only be initiated through ActionScript in response to a mouse click (including right-click) or keypress.
For users with multiple monitors, the SWF content will expand to fill only one monitor. Flash Player uses a metric to determine which monitor contains the greatest portion of the SWF, and uses that monitor for full-screen mode.
For a SWF file embedded in an HTML page, the HTML code to embed Flash Player must include a param tag and embed attribute with the name allowFullScreen and value true, like this:
PHP:
<object>
    ...
    <param name="allowFullScreen" value="true" />
    <embed ... allowfullscreen="true" />
</object>
If you are using JavaScript in a web page to generate the SWF-embedding tags, you must alter the JavaScript to add the allowFullScreen param tag and attribute. For example, if your HTML page uses the AC_FL_RunContent() function (which is used by both Flex Builder and Flash-generated HTML pages), you should add the allowFullScreen parameter to that function call as follows:
PHP:
AC_FL_RunContent(
    ...
    'allowFullScreen','true',
    ...
    ); //end AC code

This does not apply to SWF files running in the stand-alone Flash Player.

All keyboard-related ActionScript, such as keyboard events and text entry in TextField instances, is disabled in full-screen mode. The exception is the keyboard shortcuts that close full-screen mode.
There are a few additional security-related restrictions you'll want to understand, too. These are described in Security sandboxes.


[/ltr]
 

mohsensemsarpour

کاربر فعال
[ltr]
Check out the reference before asking any dumb question, and getting dumb answers!

Programming ActionScript 3.0


Display programming > Working with display objects > Setting Stage properties





Setting Stage properties
The Stage class overrides most properties and methods of the DisplayObject class. If you call one of these overridden properties or methods, Flash Player throws an exception. For example, the Stage object does not have x or y properties, since its position is fixed as the main container for the application. The x and y properties refer to the position of a display object relative to its container, and since the Stage is not contained in another display object container, these properties do not apply.

NOTE

[/ltr]

دوست عزیز سلام
خوب اینکه کاری نداره توی سایت Adobe هم هست اما باید یه نمونه انجام داد و توضیح فارسی نوشت نه این که کپی پیست کرد واقا فکر می کردم شما با این وبلاگ خوبی که دارید باید بیشتر و بهتر توضیح بدید به هر حال ممنون

راستی دوستان من ته توی قضیه رو در آوردم ببینید این توی فلش پلیر 9 اضافه شده و شما می تونید با اضافه کردن چند خط کد ساده توی html خودتون این کار رو انجام بدید در واقع دستور همون fullscreen است که با fscommand می نوشتیم اما باید html رو تغییر بدیم و فلش پلیری که خروجی می گیرید 9 باشه.

در ضمن اگر وقت شد حتما براتون نمونه ساده ایجاد می کنم با توضیح فارسی و کامل

موفق باشید
 
آخرین ویرایش:

Avang2005

مدیر انجمن
سلام دوست من

عجيبا غريبا !

همچنان منتظريم

موفق باشيد
 

shabanet

New Member
fafa mx عزیز ، من هم متوجه نشدم که از این سورس ها چه جوری استفاده کنم . خداییش این کدها رو که دیدم هاج و واج موندم :sad:ممنون میشم اگه به فارسی برام توضیح بدی یا لینک یک نمونه سورس رو بهم بدی.

محسن عزیز و نازنین ، اولا که از اینکه سعی در کمک به من داری کمال تشکر رو دارم و ان شاءلله جبران کنم . دوما اگه برات مقدور باشه یک نمونه برام بدی (سورس fla) واقعا کمک بزرگی می کنی.:oops:ممنون
 

fafa^mx

Member
توضیح بالا کامل فقط برای اینکه زیاد سر درگم نشی :
در AS 3 :
[ltr]
PHP:
stage.displayState = StageDisplayState.FULL_SCREEN;
[/ltr]
و در هنگام Inject فایل Swf به صفحه :
[ltr]
PHP:
<object>
    ...
    <param name="allowFullScreen" value="true" />
    <embed ... allowfullscreen="true" />
</object>  
[/ltr]
 

mohsensemsarpour

کاربر فعال
اینم یه Fla درست و حسابی و توپ

دوست عزیز سلام
انشاء الله که به کارتون بیاد
نمونه ساده بود که دانلودش کردم
توضیح خاصی هم نداره
موفق باشید

اگر سوالی بود در خدمتیم ...
 

پیوست ها

  • MohsenSemsarPour_FullScreen.zip
    7.8 کیلوبایت · بازدیدها: 51
آخرین ویرایش:

shabanet

New Member
محسن جان عالی بود . واقعا ازت ممنونم که کمکم کردی . نمونه ات کاملا گویا بود و نمیدونم چطور ازت تشکر کنم .
fafa mx عزیز از تو هم ممنون
 

shabanet

New Member
دوستانی که به این سوال و جوابش علاقه مندن ، پیشنهاد می دم حتما فایلی رو که محسن جان زحمت کشیدن و آپلود کردن دانلود کرده و حالش رو ببرن . من که جوابم رو گرفتم . باز هم از محسن عزیز کمال تشکر رو دارم
 

جدیدترین ارسال ها

بالا