Setup Flash Project - actionscript-3

I Have to work with Flash very first time .
Here is my scenario .
1 .I have several ActionScript file with one having initGUi Method(May be Acting like Main Method)
2 .I have a page which has with embedded flash like this
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swf" width="600" height="400">
<param name="movie" value="exp1/exp1.swf" />
<param name="allowScriptAccess" value="always" />
<embed src="Myflash.swf" width="600" height="400" allowScriptAccess="always" type="application/x-shockwave-flash" />
</object>
So When Pages opens InitGUI is called.
I am using FlashDevelop and I am not able to configure my project properly and I am not clear what Project type should be

In order to setup a new project, you have to do this:
Open FlashDevelop
Click on Project > New Project
Below "ActionScript 3" you have lots of project types. As a test, you can choose AIR AS3 Projector
Put the name of your project and choose the fold you want to place your project, then click OK
On the right side, you have your Project tree. Open the tree in "src", double click on "Main.as"
This Main.as is your start point. Try write the following:
trace("Hello World"); // You have to put this inside your public function Main
Save it and press f5. You should see an output message on the flashdevelop debbuger

Related

Stop SWF autoplay in html

How to stop auto-play of the SWF file while embedding in html.
Here is the code that I am using:
<embed type="application/x-shockwave-flash" src="videos/xxx-xxx-xxx.swf" width="100%" height="100%" style="undefined" id="Captivate" name="Captivate" bgcolor="#333333" quality="high" wmode="window" seamlesstabbing="false" menu="false" allowscriptaccess="always" flashvars="variable1=value1">
Just add ?autoplay=0 after url in embed code and let me know.
If changing autoplay on the embed code doesn't work, you could try adding this to your flash movie:
Create a new layer in your timeline and call it "actions"
Select the first frame of that layer, and press F9 to open the Actions editor.
Type in the following code: stop();
When you play the movie, it should no longer autoplay.
Look for <param name="play" value="false" /> or in embed add play="false"
This parameters stop on Main Timeline in 1st frame

"adobe flash player has stopped a potentially unsafe operation" in HTML Flash loaded

I am getting error "adobe flash player has stopped a potentially unsafe operation" when I loaded HTML Flash Browser.
When I embed swf in html with object code & used in website, it is not displayed..
Click on Settings and Edit locations to add the SWF Location
Reference from Adobe:
http://helpx.adobe.com/flash-player/kb/communicate-internet-flash-content.html
When i face this problem, i change this
<param name="allowScriptAccess" value="always" />
to
<param name="allowScriptAccess" value="never" />
This problem causes only local flash applications

Show flash while buffering?

i'm developing a web where i want to show a flash on the index page. The flash got 3Mb size. But while it is downloading, i just see a white space where it should be.
I have tried putting an image in the background, but i just see white until the flash is fully downloaded...
Any tip? I would like to see the first image of the flash, or an static image while it is loading?
im just putting it in the direct way
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="899" height="138">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="899" height="138">
<param name="movie" value="FELIPE.swf" />
<param name="quality" value="high" />
<embed src="FELIPE.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="899" height="138"></embed>
</object>
Depending on your environment, flex, flex builder, flash, etc, the method will be different. But what you are looking for is a 'preloader'. You move all your resources out of the first frame and move it to the second frame, the movie will load the first frame fast, display your 'loading message', then stop, and actionscript runs checking for the load progress of the swf, when it is complete, it advances to the second frame and plays your movie.

How do you dynamically load different streaming F4V files into one SWF player?

I need to figure out how to utilize one SWF player/file to load different streaming F4V files dynamically.
As it stands now, I have:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="500" height="314" id="something" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="/images/flash/' . $video . '" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="/images/flash/' . $video . '" quality="high" bgcolor="#ffffff" width="500" height="314" name="something" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
Currently I am publishing a separate SWF player/file for each F4V, but this is unacceptable. I need to use one SWF file to load different F4V files. I'm not that knowledgeable in the ways of Flash, but I believe that the "src" attribute of the embed tag and the "name='movie'" attribute of the object's param tag needs to point to the SWF player/file. So does anybody know how I can manipulate the object and embed tags to make them load a different F4V file into the SWF player?
Well since nobody responded it was up to me to continue my search for the answer to this one. I modified a solution taken from: http://www.webdeveloper.com/forum/showthread.php?t=185784 by infinityspiral.
It requires you to add the following line of code to the SWF player/file.
FLVPlayerInstanceName.play(this.loaderInfo.parameters.file);
After doing this and uploading it to your web server, you can access FlashVars. The one I needed to access was "file" and I simply had to feed it an rtmp call (such as "rtmp://yourserver.vod/mp4:Whatever.f4v") once in a param tag inside the object tag and once as an attribute inside the embed tag and it worked.
There does appear to be a bug with the version of Flash Media Server I'm using though... You need to be careful what directory you're putting your F4V files in on your streaming server until Adobe corrects the issue (so I had to fiddle with my rtmp call above by removing a directory level inside the call to get it to work).

Flash SWF not playing!

I created a custom video skin for my movie, and published the swf. The file plays on my Mac (using Flash player v9) but it will not play on my PC (using Flash player 10). When I uploaded it to the host, neither players will play the swf. The bitmaps in the flash file show up, but the movie won't play. I don't know if it is how I exported it or what, but it will not play! Any Idea why this is happening?
The video is hosted here:
http://hqinternetsolutions.com/YOGIPATCH/index.html
Here is my Actionscript:
flvPlayback.playPauseButton = playpausebtn;
flvPlayback.muteButton = mutebtn;
flvPlayback.volumeBar = volbar;
flvPlayback.seekBar = seekbar;
And my HTML embedded flash:
<div id="movie">
<object id="movie" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="440" height="273">
<param name="movie" value="file.swf">
<param name="quality" value="high">
<embed src="file.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="440"
height="273"></embed></object>
</div>
Just had a look using Firebug. Your swf appears to be referencing the following URL:
http://hqinternetsolutions.com/Users/larrykain/Desktop/flash%20skin/fullaquatic.flv
It's returning a 404 so it can't find the file. Looking at the URL, check the reference to how you've embedded it in the swf file.
This might be caused by different things:
Make sure the flv file is uploaded to the server along with the SWF.
Your FLV file might be blocked on the web server. Make sure it's not by pointing your browser to the actual FLV file directly (example: http://hqinternetsolutions.com/YOGIPATCH/myvideo.flv)
The flv path set in the FLVPlayback component might be too long.
Try adding a preceding / to the path of FLV in the component.