actionscript-3

disable mouse wheel scrolling while cursor over flex app?

被刻印的时光 ゝ 提交于 2019-12-30 07:19:16
问题 Is it possible to disable mousewheel scrolling on my webpage while the cursor is over my flex application? My flex application is a map that allows user to zoom in and out using the mousewheel; however, when I put my flex app onto my webpage, the scrollwheel causes the page to scroll instead of zooming in and out... Edit: I have added sounds to my flex app and it tells me my mouse events are correct. I have also added an alertbox to the javascript so that I know the MyApp.initialize function

How do I fix this cross-domain ActionScript 3 error?

旧时模样 提交于 2019-12-30 06:45:28
问题 I'm going to be as specific and verbose as possible and include some of the code I'm using. I already did a search and found this question, which seems similar; however the author there was using ActionScript 2 instead of 3, and I couldn't seem to apply any of the answers given to my own situation effectively. I am trying to emulate (in a limited way) the behavior of JavaScript's XMLHttpRequest object through Flash/ActionScript 3, in order to overcome the same-domain limitation. But I'm

How do I fix this cross-domain ActionScript 3 error?

霸气de小男生 提交于 2019-12-30 06:45:27
问题 I'm going to be as specific and verbose as possible and include some of the code I'm using. I already did a search and found this question, which seems similar; however the author there was using ActionScript 2 instead of 3, and I couldn't seem to apply any of the answers given to my own situation effectively. I am trying to emulate (in a limited way) the behavior of JavaScript's XMLHttpRequest object through Flash/ActionScript 3, in order to overcome the same-domain limitation. But I'm

Pick random Element of an Array Actionscript 3

坚强是说给别人听的谎言 提交于 2019-12-30 06:29:53
问题 I have an array of movieclips and i want to put them on stage. so they have to be unique and randomly chosen. how can I do that? thank you for your time 回答1: You can get a random number using Math.random() This will return a number between 0 and 1. So, for getting a random element of the array, use this: function getRandomElementOf(array:Array):Object { var idx:int=Math.floor(Math.random() * array.length); return array[idx]; } 回答2: If you have an Array already, you should be able to define a

FLASH save frame, to image (tiff, bmp, jpg, gif, png)

微笑、不失礼 提交于 2019-12-30 05:26:08
问题 The title sort of explains itself. I am making some 'genrative' artwork in flash. Now I want to save the frame without making a screenshot so-on and sofort. And perhaps one day i would like to save a batch of frames. Is there an AS3 class/library out there that could help me out ? 回答1: Actually, using the just released Flash 10, you CAN save to the HD! It's very handy, for just this situation. It's perfectly secure, because it only lets you save a file after the user clicks 'Save' in the file

How do I find the length of an associative array in ActionScript 3.0?

孤者浪人 提交于 2019-12-30 04:20:07
问题 Is there a simple way to retrieve the length of an associative array (implemented as an Object ) in ActionScript 3.0? I understand that there are two primary ways of creating associative arrays in AS3: Use a Dictionary object; especially handy when the key does not need to be a string Use an Object , and simply create properties for each desired element. The property name is the key, and the value is, well, the value. My application uses approach #2 (using the Object class to represent

Is it possible to embed or load SWFs when making iphone apps (Is it allowed by Apple)

荒凉一梦 提交于 2019-12-30 03:33:05
问题 I am a little confused on whether to embed swfs or load them when making apps for the iphone. Does anyone know what are the advantages of each (which is preferable to use)? I know that embedding swfs should be a little faster than loading them but is that all? Also and this is kind of important, I read that Apple will reject any app with external swfs?? Is that indeed correct? If so, will embedding or loading said swfs solve this problem? Thanks in advance EDIT: after some searching around,

Accessing the Document class in AS3

折月煮酒 提交于 2019-12-30 03:03:09
问题 How can instantiated classes access the Document class? Even after I name the Document class using the Properties bar in Flash, attempting to access it from other classes usually fails, saying "attempting to access an undefined property... One solution is always casting the Document class to itself! eg. Main(Main).globalMethod(); But sometimes even this stellar gotcha fails, and then there's usually no way out, apart from the obvious! class Other{ var parentClass:Main; public function Other

AS3 using PrintJob to print a MovieClip

三世轮回 提交于 2019-12-30 02:33:07
问题 I am currently trying to create a function which will allow me to pass in a MovieClip and print it. Here is the simplified version of the function: function printMovieClip(clip:MovieClip) { var printJob:PrintJob = new PrintJob(); var numPages:int = 0; var printY:int = 0; var printHeight:Number; if ( printJob.start() ) { /* Resize movie clip to fit within page width */ if (clip.width > printJob.pageWidth) { clip.width = printJob.pageWidth; clip.scaleY = clip.scaleX; } numPages = Math.ceil(clip

AS3 using PrintJob to print a MovieClip

你离开我真会死。 提交于 2019-12-30 02:33:04
问题 I am currently trying to create a function which will allow me to pass in a MovieClip and print it. Here is the simplified version of the function: function printMovieClip(clip:MovieClip) { var printJob:PrintJob = new PrintJob(); var numPages:int = 0; var printY:int = 0; var printHeight:Number; if ( printJob.start() ) { /* Resize movie clip to fit within page width */ if (clip.width > printJob.pageWidth) { clip.width = printJob.pageWidth; clip.scaleY = clip.scaleX; } numPages = Math.ceil(clip