Flash CS6 - What is Best Practices for Where to Put a Document Class? - flash-cs5

Suppose you are given a folder with these 5 things in it:
folder: bin
folder: src
folder: lib
folder obj
ProjectName.as3proj
I am right now just creating a .fla called ProjectNameShell.fla that is basically an empty file. I just use it to publish through CS6 and also state which class to start from. Is the standard place to put this fla in this first folder or in src?

I did something similar to this when I got fed up with Flash Builder and switched to coding in Sublime Text 2 and published using Flash CS5.5.
You want to place the ProjectNameShell.fla in the same folder as the main document class that you point to in that file. Also, if there are any external classes that you require in your code make sure to add the class paths to these files using the ActionScript 3.0 Settings in Flash preferences.

Related

How can I access an SVG included as part of my new Plasmoid in Plasma 5?

I'm trying to learn how to create Plasmoids. Right now, I have a custom SVG file that I would like to include with the Plasmoid. I can't seem to access SVG files that aren't part of my current theme, thus if I installed the plasmoid on a different installation, I would also have to add the SVG to whatever theme the user is using.
Is there a way to include the SVG in the plasmoid package, and have it installed when the plasmoid is installed? Or, otherwise, is there a way to access an SVG file that is located in the plasmoid's directory, rather than the Theme's directory?
You can use the relative path of the icon, so let's say you have a directory structure like this:
plasmoid/contents
plasmoid/contents/metadata.desktop
plasmoid/contents/ui
plasmoid/contents/ui/main.qml
And you want to use the icon in your main.qml, you can add a folder like images or whatever you want to call it and put your image into that folder:
plasmoid/contents/images/your_icon.png
now in your main.qml you can reference that icon by using smth like this:
import QtQuick 2.0
Image{
source: "../images/your_icon.png"
}

How to Embed text file in Adobe Flash for Adobe Air application

I've been searching for several days now a way to embed a data file, which is in text format, inside an app I'm trying to build in Adobe Flash for Adobe Air (for Android for now). The text file has a lot of data I want to use in my app, so I want to embed it inside the app, so when the app launches I can use it.
I've been reading about how to read and write text file in Flash and Adobe Air, but couldn't find a way to add this file to be part of my app. The Adobe Flash Library that is used for saving various assert (File > Import > Import to Library), doesn't support text file (only image, sound, video, and other graphic formats). Is there an other way to add a different (i.e. Text) file to the app?
As a last resort, and to help me proceed with the implementation, I tried manually copying the file to the Android "Documents" folder, and reading it from the app using this:
var myFile:File = File.documentsDirectory.resolvePath("MyText.txt");
var fileStream:FileStream = new FileStream();
fileStream.open(myFile, FileMode.READ);
var fileContents:String = fileStream.readUTFBytes(fileStream.bytesAvailable);
This worked on the PC when testing, but on Android it couldn't find my text file. I placed it in "My Files > Internal storage > Documents" (on Samsung phone). Is there a different "Documents" folder I should use to be found by documentsDirectory.resolvePath() function...
Anyway, as said, this was last resort solution, and much less preferred, because I don't want the users of my app to need to copy internal data files for the app to work, it should be part of the APK... So embedding the text file somehow inside the app is a much better solution, but I couldn't find a way to do that.
Thanks Organis for your answer, I didn't yet try it but I guess it should work.
I found another answer few hours ago, and will share it now, in case someone else encounters this problem.
You could embed a file from the "Publish Settings" dialog, then going into "AIR for Android Setting" (small wrench icon). On the "AIR for Android Setting" under "General" tab, at the bottom there is "Include files". You can click the [+] icon and add any file you want.
From the code you can access this file using standard file read method, using URLLoader & URLRequest functions and Event.COMPLETE to get the data when the file finishes loading.
see screenshot here

How to embed an image in windows target?

I tried to add embed = true in project xml like this:
<assets embed="true" path="Assets" rename="assets" include="*" exclude="openfl.svg" />
But if I try to delete an image from assets folder, then run the exe file, the image will not be displayed, thus, it still loaded form assets folder.
Can some one help?
Thanks every body, I found the answer of Joshua here Embeding and reading image assets when deploying to Windows
But who to know where to read about the answer in the openFL documentation?

Apportable app icon

Since the latest versions of Apportable the app icon of my app appears too small in the Android launcher (half the size of other apps' icons).
I tried to set the "ICON" property in configuration.json file but could not make it work.
"ICON": "./Icon.png",
What is the reference folder here?
I have the usual Icon-*.png files in the /Resources folder of my Obj-C code (the largest one being Icon-72#2x.png). Can I directly point to one of them ? Or do I need to copy the desired icon into the .approj folder?
File references in the configuration.json are relative to the folder that includes the .xcodeproj file.
Finally it seems that the reference folder is the "root" of the project, i.e the folder containing the .approj folder.
So in my case the following worked just fine:
"ICON": "./<app>/Resources/Icon-72#2x.png",

Path to layout xml files in magento

I have seen that we can place our layout xml files in
app/design/frontend/default/default/layout
or we can place our customization inside
app/design/frontend/base/default/layout/local.xml
file, but I have read at magebase and at magentocommerce that we can place our layout files under
app/design/frontend/your_interface/your_theme/layout/
or
app/design/frontend/[package]/[theme]/layout
So if we I have package like 'Kaushikamdotcom' in 'app/code/local', should I have to create that same package under 'app/design/frontend/' ? I tried many patterns, but nothing worked out for me.
I am quite sorry that I have made such a blunder asking this question, but I am answering this as lots of people will be making the same mistake. Package means; in the admin side of magento open
System->Configuration->Design
Then change the configuration scope to Main website. Then select Package section, uncheck the default check box and use your package name such as "Test". Then create the following folder structure.
app/design/frontend/Test/default/layout
Place your layout xml files here. If you are using your own themes use that name instead of default.
It depends what layout-xml file you have.
If you want to build up your theme, use the local.xml file in your theme dir.
If you write an extension and want to add a block to use inside this new extension, add a layout-xml file via config.xml and add it under base/default/layout/yourname.xml
When you do it this way, your theme-related changes only appear in the theme and your extension-related changes are theme-independent

Resources