Are dispatch events not necessary in Flex/ AS 3.0 [closed] - actionscript-3

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am creating a application, in which i am calling many functions, But some say, its not the right way to right the functions, you need to dispatch the events for better results. Please can anyone clear me regarding the benefits of dispatch events, as it many websites only says that "it executes an event".
The question may feel foolish, but the answer will let help me in learning flex in right way.
Thanks in Advance.

In general, if you find yourself writing code that has parent.somefunction() or outerdocument.someotherfunction(), that is the time to use events. Code like that makes the child component dependent on it's parent. The better way to have a function executed on the parent would be to use addEventListener() on the parent class to register a listener function and then to call dispatchEvent() in the child.
If you get into writing itemRenderers for datagrids or list components, you will need to learn this technique.

Related

What is the name of this technique? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Here is the link: http://codepen.io/uniZero/pen/fvkjJ
I tried to Google "fixed image backgrounds" or something similar but the result is not the same beautiful webpage with multiple backgrounds that are changing when users are scrolling the site.
I'd appreciate if someone can point me into the right direction so I can explore more and learn how to make something similar?
What are the pro and cons for such type of websites???
Thank you all in advance :)
Actually, the backgrounds are not "fixed". What's fixed is the <header>.
This technique is called as... ta-da! Fixed headers. Or, when you are using Twitter Bootstrap, they call this "Fixed Navbar" - and it's a very common component in websites using it.
The key of these is just setting an position: fixed (as you may have noticed), and a possible z-index value, so it's always on top.

How to get alert in flex web application when browser window is minimized? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
i have a flex web application. I want to show a pop-up window or alert when an event is received. even the browser window is minimized.
Thank You.
The idea would be to use the desktop notifications through Javascript. Use ExternalInterface to call Javascript from AS3.
It might not work with every browser though.
I would say that this is not possible with flex only. Since alert are just normal flash content.
Also Javascript alerts may not work.
The question is why do you need them ?

Putting code in first frame. Same as timelinecoding? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Hitting u guys with a noob question. Trying to make sense of things regarding AS3 code and where to put it. As of now I´ve been putting it on first (AND ONLY) frame in my swf's. Mixing this with use of some extended classes. Is this considered as timeline coding or is timeline coding when using the timeline and multiple frames for different kinds of code? Hope this isn´t a duplicate but I did some research and couldn´t find any specific info regarding this.
No, I would not consider it as timeline coding.
But, I would put that code in the main document class (as an external .as file).
In the Properties panel, when the stage is selected, you see a Class field:
You can assign a class to your stage, Flash will search for a file named as the class on compile-time.
Here is a tutorial:
http://active.tutsplus.com/tutorials/actionscript/quick-tip-how-to-use-a-document-class-in-flash/
Benefits will include more clarity of code, and long-time maintenance ease.

AS3 Sliding Puzzle with Tweens [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I was wondering how can a sliding puzzle can be achieved like here:
http://mypuzzle.org/sliding
i have googled all the way but unable to find any tutorial
TweenMax for tweening objects.
And I found a lot of tutorials while googling.
For example http://ajaybadgujar.com/2011/12/06/as3-number-slide-puzzle-game-for-beginners/
Or here you can find a lot of topics and source code related to puzzles
If you think you start making the application straight away, you are kinda wrong.
You have to break the app down and think what you really need.
Some quick simple model as an example:
Main menu
Grid (as array)
Tiles
Filled in grid array and updated via loops
Contain their own picture
Attach event listeners to objects (MouseEvent.CLICK or others)
Check for a win situation with every move.

Animated pictures on a website [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
How easy is it to animate 5 pictures/photos?
E.g. http://artyougrewupwith.com/
What's the best language(s) to use to do this effect?
Regards
Tea
You could either do an animated gif (which is rather old technology), or you could javascript to set a timer to switch the image sources. I would recommend using javascript code. Here is a sample:
var i=0;
var imageSrcs=['image1.png','image3.png','image3.png','image4.png','image5.png'];
var imageElement=document.getElementById('imageToAnimate');
setInterval(
function(){
imageElement.src=imageSrcs[i];
i=(i+1)%(imageSrcs.length+1);
},1000)//Every 1000 milliseconds
This will cycle through the images in the array at a rate of 1/sec and will repeat once it reaches the end.
There are at least two ways to do this (not counting Flash):
JavaScript:
Probably the most common way to do it today would be to use JavaScript. Writing it from scratch on your own might take some time, especially if you are not used to writing JavaScript. However, if you are okay with using a library like jQuery, there are plenty of plugins that does exactly that.
Here is one example:
http://nivo.dev7studios.com/
CSS
With CSS becoming increasingly more powerful through the features added with CSS3, it is also possible to accomplish a slideshow with that. Smashing Magazine has an article on how it can be achieved. Here's an example of what that could look like.
The drawback with this solution is a limited browser support for the new CSS-features.